pub enum OutputFormat {
Text,
Full,
Concise,
Grouped,
Json,
JsonLines,
GitHub,
GitLab,
Pylint,
Azure,
Sarif,
Junit,
}Expand description
Available output formats
Variants§
Text
Default human-readable format with colors and context
Full
Full format with source line display (ruff-style)
Concise
Concise format: file:line:col: [RULE] message
Grouped
Grouped format: violations grouped by file
Json
JSON format (existing)
JsonLines
JSON Lines format (one JSON object per line)
GitHub
GitHub Actions annotation format
GitLab
GitLab Code Quality format
Pylint
Pylint-compatible format: file:line:column: CODE message
Azure
Azure Pipeline logging format
Sarif
SARIF 2.1.0 format
Junit
JUnit XML format
Implementations§
Source§impl OutputFormat
impl OutputFormat
Sourcepub fn is_machine_readable(&self) -> bool
pub fn is_machine_readable(&self) -> bool
Whether this format produces machine-readable output that should not be mixed with human-readable summary lines.
Sourcepub fn is_batch(&self) -> bool
pub fn is_batch(&self) -> bool
Whether this format is a batch format: a single document spanning all results, which therefore needs every file’s warnings collected before anything is emitted. Streaming formats emit per file as results arrive.
Sourcepub fn needs_all_files(&self) -> bool
pub fn needs_all_files(&self) -> bool
Whether this batch format also reports passing files and therefore needs every checked file’s path, not just the warning-bearing ones.
Sourcepub fn format_batch(
&self,
file_warnings: &[(String, Vec<LintWarning>)],
all_files: &[String],
duration_ms: u64,
) -> Option<String>
pub fn format_batch( &self, file_warnings: &[(String, Vec<LintWarning>)], all_files: &[String], duration_ms: u64, ) -> Option<String>
Format the complete result set for a batch format. Returns None for
streaming formats, so callers can fall through to per-file output
without matching on the variants themselves.
all_files and duration_ms are consumed only by formats that report
passing files and run time (JUnit); issue-list formats ignore them.
Sourcepub fn create_formatter(&self) -> Box<dyn OutputFormatter>
pub fn create_formatter(&self) -> Box<dyn OutputFormatter>
Create a formatter instance for this format
Trait Implementations§
Source§impl Clone for OutputFormat
impl Clone for OutputFormat
Source§fn clone(&self) -> OutputFormat
fn clone(&self) -> OutputFormat
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more