Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rooignore implementation #1014

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

PoliTwit1984
Copy link

@PoliTwit1984 PoliTwit1984 commented Feb 15, 2025

Description
This PR supersedes #1013 with an improved implementation of the rooignore feature, including fixes for CodeActionProvider test mocks.

The ReclineIgnoreController implements file-based ignore patterns similar to .gitignore, allowing users to specify files and patterns in a .rooignore file that should be excluded from Roo-Code operations.

Key features:

Watches for changes to .rooignore file and updates rules automatically
Uses the 'ignore' package for gitignore-style pattern matching
Provides methods to validate file access and filter file paths
Handles relative and absolute paths correctly
Includes comprehensive test coverage
Fixes CodeActionProvider test mocks to properly handle QuickFix actions
Type of change
[x] New feature
How Has This Been Tested?
The implementation includes a comprehensive test suite that verifies:

Loading and applying .rooignore patterns correctly
Filtering file paths based on ignore rules
Handling cases where .rooignore doesn't exist
Pattern matching for both specific files and wildcards
Proper behavior with relative and absolute paths
All tests are implemented in ReclineIgnoreController.test.ts using Jest with mocked filesystem operations.

Checklist
[x] My code follows the patterns of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
Additional context
This PR includes fixes for the test failures that were present in the original PR #1013, specifically addressing the QuickFix handling in CodeActionProvider tests.

Reviewers
@RooVetGit/maintainers


Important

Implements .rooignore file handling with ReclineIgnoreController, updates extension activation, and modifies file operations to respect ignore rules, with comprehensive tests.

  • Feature:
    • Introduces ReclineIgnoreController in ReclineIgnoreController.ts to handle .rooignore file patterns, using the ignore package for pattern matching.
    • Watches .rooignore for changes and updates rules automatically.
    • Provides validateAccess() and filterPaths() methods to manage file access based on ignore rules.
    • Handles both relative and absolute paths.
  • Integration:
    • Updates extension.ts to initialize ReclineIgnoreController during activation and export it via getIgnoreController().
    • Modifies extractTextFromFile() in extract-text.ts and openFile() in open-file.ts to respect .rooignore rules.
  • Testing:
    • Adds ReclineIgnoreController.test.ts with tests for loading and applying ignore patterns, handling non-existent .rooignore, and path filtering.
    • Fixes CodeActionProvider test mocks in CodeActionProvider.test.ts to handle QuickFix actions properly.

This description was created by Ellipsis for 264aad8. It will automatically update as commits are pushed.

Copy link

changeset-bot bot commented Feb 15, 2025

⚠️ No Changeset found

Latest commit: f2f667b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ziemkowski
Copy link

ziemkowski commented Feb 15, 2025

Could .rooignore be honored in listFiles() as well? It seems like that could help with this file limit issue due to the low MAX_INITIAL_FILES constant. FYI @hannesrudolph

Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Nice! A few questions:

  1. How related are the code actions changes to this? Could they be moved to their own PR?
  2. Could we name the file RooIgnoreController?
  3. Should we also look for .clineignore to make it easier for people who use both tools?

@PoliTwit1984
Copy link
Author

Oops. Was tired :) Reclinecontroller...I'll get that changed and add .clineignore added.

@PoliTwit1984
Copy link
Author

I will also look at how much work it is to add to list files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants