fix(oxlint): v1.36.0 file discovery regression#17513
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a file discovery regression introduced in v1.36.0 where oxlint would find 0 files when walking subdirectories. The root cause was the .require_git(false) configuration, which caused the walker to traverse upward and apply parent directory .gitignore patterns (like /*.js) incorrectly to subdirectory files.
Key changes:
- Removed
.require_git(false)from the walker configuration to prevent upward traversal and incorrect application of parent.gitignorepatterns - Changed
.git_ignore(true)to.git_ignore(!options.no_ignore)to make git ignore behavior consistent with the--no-ignoreCLI option - Added regression test to verify subdirectory file discovery works correctly
- Marked previous test for
.require_git(false)functionality as ignored, with explanation of why the feature was disabled
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9dee628 to
7b1b62c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // This test must run from within the oxc repo to reproduce the bug, since it relies | ||
| // on finding the real .gitignore in the parent directory structure. |
There was a problem hiding this comment.
Hmm, do we have a way to reproduce this bug that doesn't rely on the gitignore at the root of the repo? It'd be goofy to change that and break tests.
There was a problem hiding this comment.
That's a fair point. I'll see if I can push up something to address this shortly.
7b1b62c to
276d984
Compare
|
i don't understand how this fixes the isssue? what's the root cause? |
camc314
left a comment
There was a problem hiding this comment.
this doesn't feel like a proper fix - can you explain the setup with your gitignore files and why you've got them if you're not inside a git repo?
Sure. I might have a different setup than some people. I have a Then, in my home directory, I have different Git repositories with their own files. It was in one of these Git repositories in my home directory that the original issue occurred. |
|
Hope this helps: |
|
Hmm, if we can't easily fix this by ignoring |
|
I think this is what was happening... With .require_git(false) (buggy v1.36.0):
Without .require_git(false) (this fix):
|
|
@hamirmahal can you try #17813 and see if that fixes your issue? thanks |
|
You're welcome, and thanks for looking into this. I think the approach that's there right now fixes things. |
|
|
massive apologies for the delay on this, but thank you for submitting this PR! I think i've fixed this in a slightly more ideal way, in #22033, that maintains the previous behaviour, while allowiing The fix should be released on Monday (May 4th) (or possibly tuesday due to the holiday) - please try it and let me know! Thanks! |
Fixes #17510