mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
fix(linter): output LintCommandInfo for CliRunResult::LintNoFilesFound (#8714)
In the older version we outputted the found warnings and errors (which also be zero). This is only reimplementing a part of the old behavior ands skips the old output here:4a2f2a9cd9/apps/oxlint/src/output_formatter/default.rs (L84-L110)Bug found here:659c225c56/apps/oxlint/src/snapshots/_--ignore-path%20fixtures__linter__.customignore%20fixtures__linter__nan.js%40oxlint.snap
This commit is contained in:
parent
18f1b15651
commit
e929f26826
4 changed files with 13 additions and 0 deletions
|
|
@ -147,6 +147,16 @@ impl Runner for LintRunner {
|
|||
// If explicit paths were provided, but all have been
|
||||
// filtered, return early.
|
||||
if provided_path_count > 0 {
|
||||
if let Some(end) = output_formatter.lint_command_info(&LintCommandInfo {
|
||||
number_of_files: 0,
|
||||
number_of_rules: 0,
|
||||
threads_count: rayon::current_num_threads(),
|
||||
start_time: now.elapsed(),
|
||||
}) {
|
||||
stdout.write_all(end.as_bytes()).or_else(Self::check_for_writer_error).unwrap();
|
||||
stdout.flush().unwrap();
|
||||
};
|
||||
|
||||
return CliRunResult::LintNoFilesFound;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ source: apps/oxlint/src/tester.rs
|
|||
arguments: --ignore-path fixtures/issue_7566/.oxlintignore fixtures/issue_7566/tests/main.js fixtures/issue_7566/tests/function/main.js
|
||||
working directory:
|
||||
----------
|
||||
Finished in <variable>ms on 0 files with 0 rules using 1 threads.
|
||||
----------
|
||||
CLI result: LintNoFilesFound
|
||||
----------
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ source: apps/oxlint/src/tester.rs
|
|||
arguments: --ignore-path fixtures/linter/.customignore fixtures/linter/nan.js
|
||||
working directory:
|
||||
----------
|
||||
Finished in <variable>ms on 0 files with 0 rules using 1 threads.
|
||||
----------
|
||||
CLI result: LintNoFilesFound
|
||||
----------
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ source: apps/oxlint/src/tester.rs
|
|||
arguments: -c fixtures/config_ignore_patterns/ignore_extension/eslintrc.json fixtures/config_ignore_patterns/ignore_extension/main.js
|
||||
working directory:
|
||||
----------
|
||||
Finished in <variable>ms on 0 files with 0 rules using 1 threads.
|
||||
----------
|
||||
CLI result: LintNoFilesFound
|
||||
----------
|
||||
|
|
|
|||
Loading…
Reference in a new issue