Skip to content

Commit

Permalink
feat: Report compilation warnings before errors (#2398)
Browse files Browse the repository at this point in the history
Co-authored-by: jfecher <jake@aztecprotocol.com>
  • Loading branch information
Ethan-000 and jfecher authored Aug 23, 2023
1 parent 707685c commit a1d1267
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/noirc_errors/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ pub fn report_all(
diagnostics: &[FileDiagnostic],
deny_warnings: bool,
) -> ReportedErrors {
// Report warnings before any errors
let (mut diagnostics, mut errors): (Vec<_>, _) =
diagnostics.iter().partition(|item| item.diagnostic.is_warning());
diagnostics.append(&mut errors);
let error_count =
diagnostics.iter().map(|error| error.report(files, deny_warnings) as u32).sum();

Expand Down

0 comments on commit a1d1267

Please sign in to comment.