Skip to content

Conversation

Sysix
Copy link
Member

@Sysix Sysix commented Aug 19, 2025

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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-bug Category - Bug labels Aug 19, 2025
Copy link
Member Author

Sysix commented Aug 19, 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.

Copy link

codspeed-hq bot commented Aug 19, 2025

CodSpeed Instrumentation Performance Report

Merging #13221 will not alter performance

Comparing 08-19-fix_linter_parse_ignorepatterns_with_gitignore_syntax (648e939) with main (2761300)1

Summary

✅ 34 untouched benchmarks

Footnotes

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

@Sysix Sysix force-pushed the 08-19-fix_linter_parse_ignorepatterns_with_gitignore_syntax branch from eb2f15d to 2bae6cb Compare August 19, 2025 18:58
@github-actions github-actions bot added the A-editor Area - Editor and Language Server label Aug 19, 2025
@Sysix Sysix marked this pull request as ready for review August 19, 2025 19:10
@Copilot Copilot AI review requested due to automatic review settings August 19, 2025 19:10
@Sysix Sysix requested a review from camc314 as a code owner August 19, 2025 19:10
Copy link
Contributor

@Copilot 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 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 OverrideBuilder with GitignoreBuilder for parsing ignorePatterns
  • Updates ignore pattern matching logic to use gitignore path matching methods
  • Adds new method from_base_oxlintrc to 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.

@Sysix Sysix force-pushed the 08-19-fix_linter_parse_ignorepatterns_with_gitignore_syntax branch from 2bae6cb to ea25591 Compare August 20, 2025 17:42
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Aug 22, 2025
Copy link
Contributor

camc314 commented Aug 22, 2025

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.
@graphite-app graphite-app bot force-pushed the 08-19-fix_linter_parse_ignorepatterns_with_gitignore_syntax branch from ea25591 to 648e939 Compare August 22, 2025 09:29
@graphite-app graphite-app bot merged commit 648e939 into main Aug 22, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-19-fix_linter_parse_ignorepatterns_with_gitignore_syntax branch August 22, 2025 09:34
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 22, 2025
This was referenced Aug 26, 2025
graphite-app bot pushed a commit that referenced this pull request Sep 5, 2025
closes #8842

Because of the fix in #13221 we support now allowlist too.
graphite-app bot pushed a commit that referenced this pull request Sep 5, 2025
closes #8842

Because of the fix in #13221 we support now allowlist too.
Copilot AI pushed a commit that referenced this pull request Sep 8, 2025
closes #8842

Because of the fix in #13221 we support now allowlist too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area - CLI A-editor Area - Editor and Language Server A-linter Area - Linter C-bug Category - Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linter: ignorePatterns broken since v1.12.0, last working on v1.11.2
3 participants