Skip to content

Commit

Permalink
refactor(cli): remove experimental code "module_tree_handler" (#670)
Browse files Browse the repository at this point in the history
This code will eventually be superseded by
#530, removing this for now so
others don't have to touch this.
  • Loading branch information
Boshen authored Jul 31, 2023
1 parent 5e54bd0 commit c956f7e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 316 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/oxc_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ oxc_type_synthesis = { workspace = true }
codespan-reporting = "0.11.1"

clap = { workspace = true }
crossbeam-channel = { workspace = true }
dashmap = { workspace = true }
ignore = { workspace = true, features = ["simd-accel"] }
miette = { workspace = true, features = ["fancy-no-backtrace"] }
Expand Down
18 changes: 3 additions & 15 deletions crates/oxc_cli/src/lint/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod command;
mod error;
mod isolated_handler;
mod module_tree_handler;
mod options;

use std::{io::BufWriter, sync::Arc, time::Duration};
Expand All @@ -11,10 +10,7 @@ use oxc_linter::{Linter, RuleCategory, RuleEnum, RULES};
use rustc_hash::FxHashSet;

pub use self::{error::Error, options::LintOptions};
use self::{
isolated_handler::IsolatedLintHandler, module_tree_handler::ModuleTreeLintHandler,
options::AllowWarnDeny,
};
use self::{isolated_handler::IsolatedLintHandler, options::AllowWarnDeny};
use crate::{CliRunResult, Runner};

pub struct LintRunner {
Expand Down Expand Up @@ -48,11 +44,8 @@ impl Runner for LintRunner {
return CliRunResult::None;
}

let result = if Self::enable_module_tree() {
ModuleTreeLintHandler::new(Arc::clone(&self.options), Arc::clone(&self.linter)).run()
} else {
IsolatedLintHandler::new(Arc::clone(&self.options), Arc::clone(&self.linter)).run()
};
let result =
IsolatedLintHandler::new(Arc::clone(&self.options), Arc::clone(&self.linter)).run();

if self.options.print_execution_times {
self.print_execution_times();
Expand All @@ -63,11 +56,6 @@ impl Runner for LintRunner {
}

impl LintRunner {
/// check if the module tree should be provided when linting
fn enable_module_tree() -> bool {
matches!(std::env::var("OXC_MODULE_TREE"), Ok(x) if x == "true" || x == "1")
}

fn print_rules() {
let mut stdout = BufWriter::new(std::io::stdout());
Linter::print_rules(&mut stdout);
Expand Down
296 changes: 0 additions & 296 deletions crates/oxc_cli/src/lint/module_tree_handler.rs

This file was deleted.

4 changes: 1 addition & 3 deletions crates/oxc_cli/src/lint/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ use std::{collections::BTreeMap, env, path::PathBuf};
use clap::ArgMatches;

use super::command::lint_command;
pub use super::{
error::Error, isolated_handler::IsolatedLintHandler, module_tree_handler::ModuleTreeLintHandler,
};
pub use super::{error::Error, isolated_handler::IsolatedLintHandler};
use crate::runner::RunnerOptions;

#[derive(Debug)]
Expand Down

0 comments on commit c956f7e

Please sign in to comment.