Skip to content

fix: pluginList filter #446

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

superpung
Copy link

TL;DR: Prevent ignored files from being re-included via subdirectory traversal

Hi, and thank you so much for this awesome project! ❤️
I really appreciate the work you’ve put into making it clean and useful.

While integrating the plugin system, I noticed a small issue in the file filtering logic:
Even if a file is correctly ignored via .swiftbarignore rules (e.g., test2/test2.sh), it could still be re-included later when traversing its parent directory (test2/) recursively. This behavior breaks the expectation that once a file is ignored, it should never be returned.

🔧 What this PR fixes

This PR ensures that ignored files remain excluded, even when walking through directories that themselves are not ignored. It does so by reapplying the ignore patterns during recursive traversal of filteredDirs.

✅ Example

Given a directory (can be download at test_filter.zip):

test1.sh
test2/
  └── test2.sh

With .swiftbarignore content:

test2/test2.sh

Previously: test2/test2.sh was still returned.
After this PR: only test1.sh is returned, as expected.


Let me know if you’d like any changes or test cases added — happy to iterate! Thanks again for your fantastic work! 🚀

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.

1 participant