File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -630,8 +630,11 @@ fn check_files(files: Vec<PathBuf>, opt_config: &Option<PathBuf>) -> (Vec<Format
630630 }
631631 Ok ( report) => reports. push ( report) ,
632632 Err ( err) => {
633- if let IdempotentCheckError :: Mismatch ( msg) = err {
634- print_mismatches_default_message ( msg) ;
633+ match err {
634+ IdempotentCheckError :: Mismatch ( msg) => {
635+ print_mismatches_default_message ( msg) ;
636+ }
637+ IdempotentCheckError :: Parse => { }
635638 }
636639 fails += 1 ;
637640 }
@@ -724,6 +727,10 @@ fn idempotent_check(
724727 if parsing_errors {
725728 return Err ( IdempotentCheckError :: Parse ) ;
726729 }
730+ if format_report. has_warnings ( ) {
731+ // internal warnings have higher precedence than a formatting mismatch
732+ return Ok ( format_report) ;
733+ }
727734
728735 let mut write_result = HashMap :: new ( ) ;
729736 for ( filename, text) in source_file {
You can’t perform that action at this time.
0 commit comments