-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix excluded path calculation when passing in individual files #3534
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
base: main
Are you sure you want to change the base?
Conversation
While we currently resolve globs in excluded paths when SwiftLint is run from the root directory, we do not resolve them when individual files are passed in using the `--` argument. This fixes that.
6908fce to
0fcad96
Compare
Generated by 🚫 Danger |
|
Thanks for the PR, the change looks good! It'd be great to add tests to the CLI target, but that's a different discussion. At least OSSCheck didn't surface any changes, though we're not passing individual files directly using the I'm going to run this on some closed source projects to check for possible regressions and will merge if nothing comes up. |
|
Pushed up a PR with the signposts integration: #3535 |
|
@jpsim Sorry, haven't had a chance to get back to this. I'm stuck at the part where I need to create my own sample project with hundreds of subdirectories 😅 Maybe it would be good to create some sample projects for contributors to test against? |


While we currently resolve globs in excluded paths when SwiftLint is run
from the root directory, we do not resolve them when individual files
are passed in using the
--argument. This fixes that.It doesn't look like this code path currently has any integration tests, and providing the ability to easily add new integration tests looks like a much bigger project. I have tested this locally and verified that it fixes the bug I was seeing in
0.42.0, but feel free to suggest other tests I can add within the existing test infrastructure.