Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Jun 13, 2025

Closes #4647
Fixes issue where .rooignore patterns were not working for .next folders in nested Next.js projects.

The problem was that listFiles was using a blanket '.*' pattern to exclude all hidden directories at the ripgrep level, before RooIgnoreController could process them.

Changes:

  • Replace generic '.*' pattern with specific hidden directory patterns (.git, .svn, .hg, .bzr, .vscode, .idea)
  • Remove special handling for '.*' pattern in directory filtering
  • Add test case for the reported scenario

This allows users to specify patterns like 'example-nextjs/.next/' in .rooignore and have them work correctly.


Important

Fixes .rooignore patterns to correctly ignore .next folders in nested projects by updating directory exclusion patterns and adding a test case.

  • Behavior:
    • Fixes .rooignore patterns to correctly ignore .next folders in nested projects by allowing specific patterns like example-nextjs/.next/.
    • Replaces generic .* pattern with specific hidden directory patterns in list-files.ts.
  • Tests:
    • Adds test case in RooIgnoreController.test.ts for ignoring .next folders in nested projects.
  • Misc:
    • Removes special handling for .* pattern in directory filtering in list-files.ts.

This description was created by Ellipsis for 5bf19d8. You can customize this summary. It will automatically update as commits are pushed.

Fixes #4647

The issue was that the listFiles function was using a blanket '.*' pattern
to exclude all hidden directories (directories starting with a dot) at the
ripgrep level, before the RooIgnoreController could process them.

This meant that .next folders were being filtered out during file discovery,
preventing the .rooignore patterns from working correctly for these directories.

Changes:
- Replaced the generic '.*' pattern in DIRS_TO_IGNORE with specific patterns
  for common hidden directories (.git, .svn, .hg, .bzr, .vscode, .idea)
- Removed special handling for the '.*' pattern in directory filtering logic
- Added test case to verify .next folders can now be properly controlled via .rooignore

This allows users to specify patterns like 'example-nextjs/.next/' in their
.rooignore file and have them work as expected, while still filtering out
common hidden directories that should typically be ignored.
@cte cte requested review from jr and mrubens as code owners June 13, 2025 17:57
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 13, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 13, 2025
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the integration test caught the change, now's a good time to remove that workaround

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 13, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jun 13, 2025
@daniel-lxs daniel-lxs moved this from PR [Draft / In Progress] to PR [Needs Review] in Roo Code Roadmap Jun 13, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 13, 2025
@cte cte added the roomote label Jun 13, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Review] to PR [Needs Prelim Review] in Roo Code Roadmap Jun 14, 2025
@daniel-lxs
Copy link
Member

I'll be closing this as I think it would be better to follow the same patterns that the list_files tool uses when codebase indexing is searching folders. This would ensure consistency across the codebase in how we handle directory filtering and .rooignore patterns.

@daniel-lxs daniel-lxs closed this Jun 14, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 14, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Prelim Review] to Done in Roo Code Roadmap Jun 14, 2025
@cte cte deleted the fix-rooignore-next-folder-issue-4647 branch June 16, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Preliminary Review roomote size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Roo indexes .next folder despite .rooignore file

4 participants