Skip to content

Commit 6dd4107

Browse files
committed
refactor(linter): remove #[cfg(test)] attributes from tester module (#13714)
Pure refactor. Add `#[cfg(test)]` to `tester` module, instead of to every item in the module, to simplify the code.
1 parent 5f56b09 commit 6dd4107

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

apps/oxlint/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ mod js_plugins;
1010
mod lint;
1111
mod output_formatter;
1212
mod result;
13-
mod tester;
1413
mod walk;
1514

15+
#[cfg(test)]
16+
mod tester;
17+
1618
pub mod cli {
1719
pub use crate::{command::*, lint::LintRunner, result::CliRunResult};
1820
}

apps/oxlint/src/tester.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
#[cfg(test)]
21
use std::{env, path::PathBuf};
32

4-
#[cfg(test)]
53
use cow_utils::CowUtils;
6-
#[cfg(test)]
74
use lazy_regex::Regex;
85

9-
#[cfg(test)]
106
use crate::cli::{LintRunner, lint_command};
117

12-
#[cfg(test)]
138
pub struct Tester {
149
cwd: PathBuf,
1510
}
1611

17-
#[cfg(test)]
1812
impl Tester {
1913
pub fn new() -> Self {
2014
let cwd = env::current_dir().unwrap();

0 commit comments

Comments
 (0)