-
-
Notifications
You must be signed in to change notification settings - Fork 722
fix(linter): parse ignorePatterns with gitignore syntax
#13221
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
fix(linter): parse ignorePatterns with gitignore syntax
#13221
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
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. |
CodSpeed Instrumentation Performance ReportMerging #13221 will not alter performanceComparing Summary
Footnotes |
eb2f15d to
2bae6cb
Compare
There was a problem hiding this 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 changes the linter's ignorePatterns parsing to use gitignore syntax instead of override syntax, addressing issue #13204. The change switches from OverrideBuilder to GitignoreBuilder to properly handle path matching with gitignore semantics.
- Replaces
OverrideBuilderwithGitignoreBuilderfor parsingignorePatterns - Updates ignore pattern matching logic to use gitignore path matching methods
- Adds new method
from_base_oxlintrcto handle ignore root directory configuration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_linter/src/config/mod.rs | Switches from Override to Gitignore types and updates pattern resolution logic |
| crates/oxc_linter/src/config/config_store.rs | Updates path matching to use gitignore's matched_path_or_any_parents method |
| crates/oxc_linter/src/config/config_builder.rs | Adds new methods to handle ignore root directory and removes negation prefix from patterns |
| crates/oxc_language_server/src/linter/server_linter.rs | Updates to use the new from_base_oxlintrc method |
| apps/oxlint/src/lint.rs | Updates to use the new from_base_oxlintrc method and adds test case |
| apps/oxlint/fixtures/* | Adds test fixtures and snapshots for non-glob syntax ignore patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
2bae6cb to
ea25591
Compare
Merge activity
|
closes #13204 Why I need now a `GitignoreBuilder` instead of `OverrideBuilder` like before #12210. Because `Gitignore::matched_path_or_any_parents` only allows paths inside his root, I needed to "trick" a bit. Or else the test with `--config another/directory/config.json` would fail. Now, the base `ignorePatterns` will always be at the current working directory.
ea25591 to
648e939
Compare

closes #13204
Why I need now a
GitignoreBuilderinstead ofOverrideBuilderlike before #12210.Because
Gitignore::matched_path_or_any_parentsonly allows paths inside his root, I needed to "trick" a bit.Or else the test with
--config another/directory/config.jsonwould fail.Now, the base
ignorePatternswill always be at the current working directory.