Skip to content

refactor(linter): move ignore logic to LintIgnoreMatcher#13222

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_
Aug 26, 2025
Merged

refactor(linter): move ignore logic to LintIgnoreMatcher#13222
graphite-app[bot] merged 1 commit intomainfrom
08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Aug 19, 2025

Moved the logic into an own struct.
oxlint does it only need at the beginning for prefiltering the files.
oxc_language_server needs to keep the ignores alive.

Before the LintConfig would hold it, which is too long for oxlint.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 19, 2025

CodSpeed Instrumentation Performance Report

Merging #13222 will not alter performance

Comparing 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ (6431033) with main (1cdc420)1

Summary

✅ 34 untouched benchmarks

Footnotes

  1. No successful run was found on main (6431033) during the generation of this report, so 1cdc420 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-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 1e7b9dc to 30b344d Compare August 19, 2025 22:18
@github-actions github-actions bot added the A-editor Area - Editor and Language Server label Aug 19, 2025
@Sysix Sysix force-pushed the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 30b344d to 8d62e96 Compare August 19, 2025 22:33
@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
@Sysix Sysix force-pushed the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 8d62e96 to 75b18f8 Compare August 20, 2025 17:42
@Sysix Sysix marked this pull request as ready for review August 20, 2025 17:46
@Sysix Sysix requested a review from camc314 as a code owner August 20, 2025 17:46
@Sysix Sysix force-pushed the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 75b18f8 to 8bbe1f5 Compare August 20, 2025 18:02
@graphite-app graphite-app bot changed the base branch from 08-19-fix_linter_parse_ignorepatterns_with_gitignore_syntax to graphite-base/13222 August 22, 2025 09:29
@graphite-app graphite-app bot force-pushed the graphite-base/13222 branch from ea25591 to 648e939 Compare August 22, 2025 09:35
@graphite-app graphite-app bot force-pushed the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 8bbe1f5 to 8927fe2 Compare August 22, 2025 09:35
@graphite-app graphite-app bot changed the base branch from graphite-base/13222 to main August 22, 2025 09:35
@graphite-app graphite-app bot force-pushed the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 8927fe2 to 8cef190 Compare August 22, 2025 09:36
@camc314 camc314 requested a review from Copilot August 22, 2025 09:56
@camc314 camc314 self-assigned this Aug 22, 2025
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 refactors ignore pattern handling by moving logic from LintConfig into a new dedicated LintIgnoreMatcher struct. This improves separation of concerns, allowing oxlint to prefilter files early while enabling oxc_language_server to keep ignore patterns alive throughout its lifecycle.

  • Extracted ignore pattern matching logic into a dedicated LintIgnoreMatcher struct
  • Removed ignore pattern storage and methods from LintConfig and ConfigStore
  • Updated both oxlint and oxc_language_server to use the new matcher for file filtering

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/oxc_linter/src/config/ignore_matcher.rs New file implementing LintIgnoreMatcher with base and nested pattern support
crates/oxc_linter/src/config/mod.rs Removes ignore pattern fields and methods from LintConfig
crates/oxc_linter/src/config/config_store.rs Removes ignore pattern methods from Config and ConfigStore
crates/oxc_linter/src/config/config_builder.rs Removes ignore pattern resolution from config building
crates/oxc_linter/src/service/mod.rs Removes should_ignore method from LintService
crates/oxc_language_server/src/linter/server_linter.rs Integrates LintIgnoreMatcher for ignore pattern handling
crates/oxc_language_server/src/linter/isolated_lint_handler.rs Removes ignore check delegation to service
apps/oxlint/src/lint.rs Uses LintIgnoreMatcher for file filtering instead of ConfigStore

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-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 8cef190 to 76eed21 Compare August 24, 2025 11:42
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Aug 26, 2025
Copy link
Member

Boshen commented Aug 26, 2025

Merge activity

  • Aug 26, 2:39 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 26, 2:40 AM UTC: Boshen added this pull request to the Graphite merge queue.
  • Aug 26, 2:46 AM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.
  • Aug 26, 5:05 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 26, 5:05 PM UTC: Sysix added this pull request to the Graphite merge queue.
  • Aug 26, 5:10 PM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 26, 2025
@Sysix Sysix force-pushed the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from 76eed21 to e9be0ed Compare August 26, 2025 16:57
@Sysix Sysix added the 0-merge Merge with Graphite Merge Queue label Aug 26, 2025
Moved the logic into an own struct.
`oxlint` does it only need at the beginning for prefiltering the files.
`oxc_language_server` needs to keep the ignores alive.

Before the `LintConfig` would hold it, which is too long for `oxlint`.
@graphite-app graphite-app bot force-pushed the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch from e9be0ed to 6431033 Compare August 26, 2025 17:06
@graphite-app graphite-app bot merged commit 6431033 into main Aug 26, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-19-refactor_linter_move_ignore_logic_to_lintignorematcher_ branch August 26, 2025 17:10
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Aug 26, 2025
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-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants