pub trait OutputFormatter {
// Required method
fn format_warnings(
&self,
warnings: &[LintWarning],
file_path: &str,
) -> String;
// Provided methods
fn format_warnings_with_content(
&self,
warnings: &[LintWarning],
file_path: &str,
_content: &str,
) -> String { ... }
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§
Sourcefn format_warnings(&self, warnings: &[LintWarning], file_path: &str) -> String
fn format_warnings(&self, warnings: &[LintWarning], file_path: &str) -> String
Format a collection of warnings for output
Provided Methods§
Sourcefn format_warnings_with_content(
&self,
warnings: &[LintWarning],
file_path: &str,
_content: &str,
) -> String
fn format_warnings_with_content( &self, warnings: &[LintWarning], file_path: &str, _content: &str, ) -> String
Format warnings with file content for source line display.
Formatters that show source context (e.g., Full) override this.
Default delegates to format_warnings.
Sourcefn format_summary(
&self,
_files_processed: usize,
_total_warnings: usize,
_duration_ms: u64,
) -> Option<String>
fn format_summary( &self, _files_processed: usize, _total_warnings: usize, _duration_ms: u64, ) -> Option<String>
Format a summary of results across multiple files
Sourcefn use_colors(&self) -> bool
fn use_colors(&self) -> bool
Whether this formatter should use colors