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
630
630
}
631
631
Ok ( report) => reports. push ( report) ,
632
632
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 => { }
635
638
}
636
639
fails += 1 ;
637
640
}
@@ -724,6 +727,10 @@ fn idempotent_check(
724
727
if parsing_errors {
725
728
return Err ( IdempotentCheckError :: Parse ) ;
726
729
}
730
+ if format_report. has_warnings ( ) {
731
+ // internal warnings have higher precedence than a formatting mismatch
732
+ return Ok ( format_report) ;
733
+ }
727
734
728
735
let mut write_result = HashMap :: new ( ) ;
729
736
for ( filename, text) in source_file {
You can’t perform that action at this time.
0 commit comments