diff --git a/src/test/mod.rs b/src/test/mod.rs index ab966d4a360..10b49774a1d 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -630,8 +630,11 @@ fn check_files(files: Vec, opt_config: &Option) -> (Vec reports.push(report), Err(err) => { - if let IdempotentCheckError::Mismatch(msg) = err { - print_mismatches_default_message(msg); + match err { + IdempotentCheckError::Mismatch(msg) => { + print_mismatches_default_message(msg); + } + IdempotentCheckError::Parse => {} } fails += 1; } @@ -724,6 +727,10 @@ fn idempotent_check( if parsing_errors { return Err(IdempotentCheckError::Parse); } + if format_report.has_warnings() { + // internal warnings have higher precedence than a formatting mismatch + return Ok(format_report); + } let mut write_result = HashMap::new(); for (filename, text) in source_file {