OutputFormatter

Trait OutputFormatter 

Source
pub trait OutputFormatter {
    // Required method
    fn format_warnings(
        &self,
        warnings: &[LintWarning],
        file_path: &str,
    ) -> String;

    // Provided methods
    fn format_summary(
        &self,
        _files_processed: usize,
        _total_warnings: usize,
        _duration_ms: u64,
    ) -> Option<String> { ... }
    fn use_colors(&self) -> bool { ... }
}
Expand description

Trait for output formatters

Required Methods§

Source

fn format_warnings(&self, warnings: &[LintWarning], file_path: &str) -> String

Format a collection of warnings for output

Provided Methods§

Source

fn format_summary( &self, _files_processed: usize, _total_warnings: usize, _duration_ms: u64, ) -> Option<String>

Format a summary of results across multiple files

Source

fn use_colors(&self) -> bool

Whether this formatter should use colors

Implementors§