Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(linter)!: report unmatched rules with error exit code #7027

Conversation

camchenry
Copy link
Contributor

@camchenry camchenry commented Oct 30, 2024

we now return an error exit code when there are unmatched rules. previously, we would print an error to stderr and continue running. however, this masked errors in some tests that actually had unmatched rules in them. these test cases now trigger a panic (in tests only, not at runtime), and help ensure that we are reporting an error message to the user for unknown rules, which we did not have any tests cases for before.

this also fixes #7025, where we were reporting rules as unmatched simply because they had been disabled prior to being configured. similar to #7009.

Copy link

graphite-app bot commented Oct 30, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

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

Copy link
Contributor Author

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

Join @camchenry and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-editor Area - Editor and Language Server C-enhancement Category - New feature or request labels Oct 30, 2024
Copy link

codspeed-hq bot commented Oct 30, 2024

CodSpeed Performance Report

Merging #7027 will not alter performance

Comparing 10-30-feat_linter_report_unmatched_rules_with_error_exit_code (1f2a6c6) with main (86ab091)

Summary

✅ 30 untouched benchmarks

@camchenry camchenry force-pushed the 10-30-feat_linter_report_unmatched_rules_with_error_exit_code branch from a2d1e2a to 5078f69 Compare October 30, 2024 14:35
@camchenry camchenry requested review from DonIsaac and Boshen October 30, 2024 14:36
@camchenry camchenry marked this pull request as ready for review October 30, 2024 14:36
@camchenry camchenry force-pushed the 10-30-feat_linter_report_unmatched_rules_with_error_exit_code branch 2 times, most recently from 30660e0 to f7134d9 Compare October 30, 2024 14:57
@Boshen Boshen changed the title feat(linter): report unmatched rules with error exit code feat(linter)!: report unmatched rules with error exit code Oct 30, 2024
@Boshen Boshen self-assigned this Oct 30, 2024
Copy link
Contributor

@DonIsaac DonIsaac left a comment

Choose a reason for hiding this comment

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

I need to review this more thoroughly. I'll keep looking when I have time (tonight or tomorrow)

crates/oxc_linter/src/builder.rs Outdated Show resolved Hide resolved
@camchenry camchenry force-pushed the 10-30-feat_linter_report_unmatched_rules_with_error_exit_code branch from f7134d9 to 4dfd1e9 Compare October 31, 2024 00:18
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Nov 1, 2024
Copy link
Member

Boshen commented Nov 1, 2024

Merge activity

  • Oct 31, 11:26 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Oct 31, 11:26 PM EDT: A user added this pull request to the Graphite merge queue.
  • Oct 31, 11:31 PM EDT: A user merged this pull request with the Graphite merge queue.

- closes #6988

we now return an error exit code when there are unmatched rules. previously, we would print an error to stderr and continue running. however, this masked errors in some tests that actually had unmatched rules in them. these test cases now trigger a panic (in tests only, not at runtime), and help ensure that we are reporting an error message to the user for unknown rules, which we did not have any tests cases for before.

- fixes #7025

this also fixes #7025, where we were reporting rules as unmatched simply because they had been disabled prior to being configured. similar to #7009.
@Boshen Boshen force-pushed the 10-30-feat_linter_report_unmatched_rules_with_error_exit_code branch from 4dfd1e9 to 1f2a6c6 Compare November 1, 2024 03:27
@graphite-app graphite-app bot merged commit 1f2a6c6 into main Nov 1, 2024
26 checks passed
@graphite-app graphite-app bot deleted the 10-30-feat_linter_report_unmatched_rules_with_error_exit_code branch November 1, 2024 03:31
@Boshen
Copy link
Member

Boshen commented Nov 1, 2024

https://github.com/oxc-project/oxlint-ecosystem-ci/actions/runs/11623823150/job/32371532541

We need to fix preact with this change 😅

@oxc-bot oxc-bot mentioned this pull request Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-cli Area - CLI A-editor Area - Editor and Language Server A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linter: bail unmatched rules linter: rule incorrectly reported as unmatched
4 participants