Skip to content

Add support for ignoring files#54

Open
alxshine wants to merge 4 commits intotrailofbits:mainfrom
alxshine:ignored-files
Open

Add support for ignoring files#54
alxshine wants to merge 4 commits intotrailofbits:mainfrom
alxshine:ignored-files

Conversation

@alxshine
Copy link

Hello hello 👋 😊

This PR implements the feature requested in #32.

The handling of ignoredFiles is very closely modeled on the handling of auditedFiles.

The checkIfAllSiblingFilesAreAudited now checks if the candidate file is either audited or ignored, causing a directory full of ignored files to be seen as audited. This seemed like the simplest way to integrated it into the existing functionality.

In the explorer view, ignored files are indicated in the same color as gitignored files.

@CLAassistant
Copy link

CLAassistant commented Sep 20, 2024

CLA assistant check
All committers have signed the CLA.

@fcasal
Copy link
Collaborator

fcasal commented Oct 1, 2024

Hi @alxshine,
I haven't yet reviewed this PR because we want to merge a big refactor of the codebase #48 first.
As a high level comment about the PR I think I would like to handle ignored files using a .weauditignore file -- in a way that if you mark a file as ignored, it would be also added to the .weauditignore file. In that file, you could also specify folders or globing behaviour like you can in .gitignore

@dguido
Copy link
Member

dguido commented Jan 21, 2026

Review

Thanks for this feature! The "ignored files" concept is useful - allowing files to be marked as intentionally skipped (e.g., vendor files, generated code) while still counting toward folder completion.

Architectural Conflict

Similar to PR #57, this PR was written against an older version of the codebase that has since been significantly refactored. Main now uses a workspaces (MultiRootManager) abstraction instead of direct array manipulation.

Your PR uses:

  • this.workspacePath
  • this.ignoredFiles (new array)
  • this.auditedFiles (direct array access)
  • Direct path manipulation with path.relative

Main now uses:

  • this.workspaces.toggleAudited(uri)
  • this.workspaces.getRoots()
  • Workspace-aware file management (supports multi-root workspaces)

Feature Design Considerations

When updating this for the new architecture:

  1. The ignoredFiles array should be added to the SerializedData type and MultiRootManager
  2. Need to ensure ignored files are persisted in .weaudit files
  3. Consider how ignored files should appear in the tree view (different icon/color?)
  4. The checkIfAllSiblingFilesAreAudited logic change is correct but needs to use the new API

Recommended Next Steps

  1. Rebase on main (expect conflicts in src/codeMarker.ts)
  2. Add ignoredFiles to the MultiRootManager class similar to how auditedFiles is handled
  3. Update toggleIgnored to use this.workspaces.toggleIgnored(uri) pattern
  4. Update serialization/deserialization to include ignored files

I'd be happy to help with the implementation if you'd like!

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.

4 participants