Skip to content

Comments

fix(linter): report correct diagnostic count on minified files#13896

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/09-18-fix_linter_report_correct_diagnostic_count_on_minified_files
Sep 21, 2025
Merged

fix(linter): report correct diagnostic count on minified files#13896
graphite-app[bot] merged 1 commit intomainfrom
c/09-18-fix_linter_report_correct_diagnostic_count_on_minified_files

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Sep 18, 2025

fixes #13865

testing this is tricky as we have a different impl for cfg test which means this code path is never hit. but i tested this in vscode repo and appears to work as expected

@github-actions github-actions bot added the C-bug Category - Bug label Sep 18, 2025
Copy link
Contributor Author

camc314 commented Sep 18, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camc314 camc314 marked this pull request as ready for review September 18, 2025 15:41
Copilot AI review requested due to automatic review settings September 18, 2025 15:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue where the linter was not reporting the correct diagnostic count on minified files. The fix ensures that when a minified file is detected, subsequent diagnostics are properly skipped from output while still being counted.

  • Introduces tracking of minified file state to prevent output of diagnostics after minification is detected
  • Replaces break with continue to maintain diagnostic counting while suppressing output
  • Adds condition to skip diagnostic output for minified files similar to silent mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 18, 2025

CodSpeed Instrumentation Performance Report

Merging #13896 will not alter performance

Comparing c/09-18-fix_linter_report_correct_diagnostic_count_on_minified_files (2a7d5d3) with main (af8473a)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (2a7d5d3) during the generation of this report, so af8473a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel
Copy link
Member

I'm not sure if this is correct or not.

I can confirm that the number of warnings + errors reported in summary is now the same with / without --silent.

But... the number in summary does not correspond to the actual number of warnings/errors output.

In Kibana repo, after this PR:

% node path/to/oxc/apps/oxlint/dist/cli.js
<itemized 16881 warnings, 8 errors>
Found 64036 warnings and 8 errors.
Finished in 2.9s on 76140 files with 88 rules using 14 threads.

% node path/to/oxc/apps/oxlint/dist/cli.js --silent
Found 64036 warnings and 8 errors.
Finished in 1.9s on 76140 files with 88 rules using 14 threads.

Previously:

% node path/to/oxc/apps/oxlint/dist/cli.js
<itemized 16881 warnings, 8 errors>
Found 16881 warnings and 6 errors.
Finished in 2.5s on 76138 files with 88 rules using 14 threads.

% node path/to/oxc/apps/oxlint/dist/cli.js --silent
Found 64036 warnings and 6 errors.
Finished in 3.0s on 76138 files with 88 rules using 14 threads.

Is this intentional?

(I'm unclear why we skip linting minified files anyway, I'd have expected user should exclude any files they don't want linted)

@camc314
Copy link
Contributor Author

camc314 commented Sep 20, 2025

tbh i think this is fine. It isn't perfect but it's happening because, we are printing a warning diagnostic, when we find a minified file, and skipping the rest of the diagnostics for this file.

people should be ignoring stuff in their dist directories anyway so this is very much an edge case imo

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 21, 2025
Copy link
Member

overlookmotel commented Sep 21, 2025

Merge activity

fixes #13865

testing this is tricky as we have a different impl for cfg test which means this code path is never hit. but i tested this in vscode repo and appears to work as expected
@graphite-app graphite-app bot force-pushed the c/09-18-fix_linter_report_correct_diagnostic_count_on_minified_files branch from 1f41408 to 2a7d5d3 Compare September 21, 2025 15:15
@graphite-app graphite-app bot merged commit 2a7d5d3 into main Sep 21, 2025
25 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 21, 2025
@graphite-app graphite-app bot deleted the c/09-18-fix_linter_report_correct_diagnostic_count_on_minified_files branch September 21, 2025 15:21
This was referenced Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: --silent affects error count

2 participants