Skip to content

Commit

Permalink
Don't drop internal warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
camsteffen committed Feb 8, 2022
1 parent 5df8c8f commit f07d962
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,11 @@ fn check_files(files: Vec<PathBuf>, opt_config: &Option<PathBuf>) -> (Vec<Format
}
Ok(report) => 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;
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f07d962

Please sign in to comment.