Skip to content

Commit

Permalink
fix(linter): output LintCommandInfo for `CliRunResult::LintNoFilesF…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Jan 31, 2025
1 parent 18f1b15 commit e929f26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions ...es__issue_7566__tests__main.js [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------

0 comments on commit e929f26

Please sign in to comment.