Skip to content

fix(linter): fix ignorePattern config for windows #8214

Merged
Boshen merged 11 commits intooxc-project:mainfrom
Sysix:fix-linter-ignore-pattern-under-windows
Jan 2, 2025
Merged

fix(linter): fix ignorePattern config for windows #8214
Boshen merged 11 commits intooxc-project:mainfrom
Sysix:fix-linter-ignore-pattern-under-windows

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Jan 1, 2025

Changes:

  • Config ignorePatterns not as Path, because the create ignore does only handle / and not Win-style \
  • Passed full path to the config and do not use canonicalize because it prefix the paths with \\?\,
    read more here: https://stackoverflow.com/a/41233992/7387397
  • Updated and enabled tests for windows, some are still failing

closes #8188

@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 1, 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.

@github-actions github-actions bot added the A-cli Area - CLI label Jan 1, 2025
@Sysix Sysix changed the title Fix linter ignore pattern under windows fix(linter): fix ignorePattern config for windows Jan 1, 2025
@Sysix Sysix changed the title fix(linter): fix ignorePattern config for windows fix(linter): fix ignorePattern config for windows Jan 1, 2025
@github-actions github-actions bot added the C-bug Category - Bug label Jan 1, 2025
@github-actions github-actions bot added the A-linter Area - Linter label Jan 1, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 1, 2025

CodSpeed Performance Report

Merging #8214 will not alter performance

Comparing Sysix:fix-linter-ignore-pattern-under-windows (28d1386) with main (05be1fc)

Summary

✅ 29 untouched benchmarks

@Sysix Sysix marked this pull request as ready for review January 1, 2025 22:07
@Boshen Boshen merged commit 2b14a6f into oxc-project:main Jan 2, 2025
@oxc-bot oxc-bot mentioned this pull request Jan 2, 2025
Boshen added a commit that referenced this pull request Jan 2, 2025
## [0.15.5] - 2025-01-02

### Features

- 0e168b8 linter: Catch more cases in const-comparisons (#8215)
(Cameron)
- bde44a3 linter: Add `statement_span` to `ModuleRecord/ImportEntry`
(#8195) (Alexander S.)
- ccaa9f7 linter: Implement `eslint/new-cap`  (#8146) (Alexander S.)

### Bug Fixes

- 2b14a6f linter: Fix `ignorePattern` config for windows (#8214)
(Alexander S.)

### Testing

- cb709c9 linter: Fix some oxlint tests on windows (#8204) (Cameron)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sysix pushed a commit that referenced this pull request Jan 26, 2025
closes #8594 

This is because previously, oxlintrc.path was determined by
`path.canonicalize().unwrap_or_else(|_| path.to_path_buf())`, but after
#8214, it was changed to `path.to_path_buf()`. As a result,
`\\?\D:\shulaoda` became `D:\shulaoda`. This caused the condition
`uri_path.starts_with(gitignore.path())` to evaluate as `true`,
preventing the bypass of the `is_ignore` check and exposing the original
code issue.


https://github.com/oxc-project/oxc/blob/b1499e6711e3e79053b86192cb6a635000abc23b/crates/oxc_language_server/src/main.rs#L531-L533
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oxlint config file not work on Windows

3 participants