-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Make forceExclude work with directly specified files #4609
Make forceExclude work with directly specified files #4609
Conversation
Generated by 🚫 Danger |
@jpsim could you perhaps have a look at this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change seems reasonable to me. Thank you for the fix! I only have two small suggestions.
Source/SwiftLintFramework/Extensions/Configuration+LintableFiles.swift
Outdated
Show resolved
Hide resolved
Source/SwiftLintFramework/Extensions/Configuration+LintableFiles.swift
Outdated
Show resolved
Hide resolved
@SimplyDanny thanks for the review! I've implemented the requested change. |
@jimmya: Thank you for taking care of the comments! Could you please rebase your changes once more to fix the failing tests? |
cba8372
to
c3e42b4
Compare
@SimplyDanny thanks for approving. I've rebased and added my changelog entry |
It seemed that
--force-exclude
didn't work when providing files directly..swiftlint.yml:
Directory contents:
When specifying a file that matches this excluded list:
Because it fell through the if statement it started linting all included files.
When specifying a file that doesn't match:
➜ swiftlint --config .swiftlint.yml --force-exclude Source/Foo.swift Linting Swift files at paths Source/Foo.swift Linting 'Foo.swift' (1/1)
Expected result:
➜ swiftlint --config .swiftlint.yml --force-exclude Source/FooTest.swift Linting Swift files at paths Source/FooTest.swift Error: No lintable files found at paths: 'Source/FooTest.swift'
This PR makes sure that this excluded list is taken into account when specifying the
--force-exclude
flag.