Skip to content

Commit

Permalink
Suppress build summary message for non-human output modes. (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertCreativityHere authored Sep 10, 2024
1 parent cac8703 commit 5bc3e41
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/compilation_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::ast::Ast;
use crate::diagnostic_emitter::{emit_totals, DiagnosticEmitter};
use crate::diagnostics::{get_totals, Diagnostic, Diagnostics};
use crate::slice_file::SliceFile;
use crate::slice_options::SliceOptions;
use crate::slice_options::{DiagnosticFormat, SliceOptions};

#[derive(Debug, Default)]
pub struct CompilationState {
Expand Down Expand Up @@ -54,7 +54,11 @@ impl CompilationState {
let mut stderr = console::Term::stderr();
let mut emitter = DiagnosticEmitter::new(&mut stderr, options, &self.files);
DiagnosticEmitter::emit_diagnostics(&mut emitter, diagnostics).expect("failed to emit diagnostics");
emit_totals(total_warnings, total_errors).expect("failed to emit totals");

// Only emit the summary message if we're writing human-readable output.
if options.diagnostic_format == DiagnosticFormat::Human {
emit_totals(total_warnings, total_errors).expect("failed to emit totals");
}

total_errors != 0
}
Expand Down

0 comments on commit 5bc3e41

Please sign in to comment.