From a8dc75d6ba94b88e13f985fde7bbf4a47f482e96 Mon Sep 17 00:00:00 2001 From: camchenry <1514176+camchenry@users.noreply.github.com> Date: Sat, 2 Nov 2024 06:17:28 +0000 Subject: [PATCH] refactor(linter): remove unused CLI result types (#7088) It doesn't seem like we should implement type checking or formatting in the `oxlint` binary. Plus, these are unused currently. So I removed them. --- apps/oxlint/src/result.rs | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/apps/oxlint/src/result.rs b/apps/oxlint/src/result.rs index e3610ab7a14ca..bfd953337c97e 100644 --- a/apps/oxlint/src/result.rs +++ b/apps/oxlint/src/result.rs @@ -19,11 +19,6 @@ pub enum CliRunResult { error: String, }, LintResult(LintResult), - FormatResult(FormatResult), - TypeCheckResult { - duration: Duration, - number_of_diagnostics: usize, - }, PrintConfigResult { config_file: String, }, @@ -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 { @@ -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)