Skip to content

Commit

Permalink
refactor(linter): remove unused CLI result types
Browse files Browse the repository at this point in the history
  • Loading branch information
camchenry committed Nov 2, 2024
1 parent d89fe2c commit c22b385
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions apps/oxlint/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ pub enum CliRunResult {
error: String,
},
LintResult(LintResult),
FormatResult(FormatResult),
TypeCheckResult {
duration: Duration,
number_of_diagnostics: usize,
},
PrintConfigResult {
config_file: String,
},
Expand All @@ -50,12 +45,6 @@ pub struct LintResult {
pub print_summary: bool,
}

#[derive(Debug)]
pub struct FormatResult {
pub duration: Duration,
pub number_of_files: usize,
}

impl Termination for CliRunResult {
#[allow(clippy::print_stdout, clippy::print_stderr)]
fn report(self) -> ExitCode {
Expand Down Expand Up @@ -115,26 +104,6 @@ impl Termination for CliRunResult {
u8::from((number_of_warnings > 0 && deny_warnings) || number_of_errors > 0);
ExitCode::from(exit_code)
}
Self::FormatResult(FormatResult { duration, number_of_files }) => {
let threads = rayon::current_num_threads();
let time = Self::get_execution_time(&duration);
let s = if number_of_files == 1 { "" } else { "s" };
println!(
"Finished in {time} on {number_of_files} file{s} using {threads} threads."
);
ExitCode::from(0)
}
Self::TypeCheckResult { duration, number_of_diagnostics } => {
let time = Self::get_execution_time(&duration);
println!("Finished in {time}.");

if number_of_diagnostics > 0 {
println!("Found {number_of_diagnostics} errors.");
return ExitCode::from(1);
}

ExitCode::from(0)
}
Self::PrintConfigResult { config_file } => {
println!("{config_file}");
ExitCode::from(0)
Expand Down

0 comments on commit c22b385

Please sign in to comment.