fix(linter): respect .gitignore regardless of if a git repo is initialized#17375
Conversation
.gitignore regardless of if a git repo is initialized
You were correct! The initial test was passing even without the changes because it was using explicit I've updated the implementation to include both
The key insight was that Commit: d32a50a |
|
@copilot fix CI |
|
@Boshen mind taking a quick look? |
There was a problem hiding this comment.
Pull request overview
This PR enables oxlint to respect .gitignore files even when a Git repository hasn't been initialized (i.e., when there's no .git directory). This resolves unexpected behavior where .gitignore files were only honored in initialized Git repositories.
Key Changes
- Modified
WalkBuilderconfiguration to explicitly enable.gitignoreprocessing and remove the Git repository requirement - Added comprehensive unit test validating
.gitignoreauto-discovery without.gitdirectory - Improved code formatting for the builder chain
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
…ialized (#17375) ## Plan: Enable oxlint to read gitignore without git repo initialization - [x] Analyze the issue and understand the problem - [x] Add `.require_git(false)` and `.git_ignore(true)` to WalkBuilder in walk.rs - [x] Create a proper unit test in walk.rs that validates auto-discovery of .gitignore files - [x] Verify test fails without the settings and passes with them - [x] Remove old integration test that didn't properly test the fix - [x] Run all tests to ensure no regressions - [x] Verify the fix manually with CLI - [x] Fix formatting issues for CI <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > update oxlint to read from the gitignore even if the git repo has not been initialized </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
9c6662e to
fec2863
Compare
Plan: Enable oxlint to read gitignore without git repo initialization
.require_git(false)and.git_ignore(true)to WalkBuilder in walk.rsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.