fix: pluginList filter #446
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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):
With
.swiftbarignore
content: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! 🚀