-
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
False positive for trailing_closure
rule with anonymous closure call
#2159
Comments
Also looks like a similar bug: |
@pashcal for future reference: what you're describing is not bug: the rule checks all closures that can be closure. If you believe the first one is more readable, please open an issue to track adding a configuration to treat it as a special case. Please try to specify the enhancement as a generic case. When should the rule ignore the fact that a closure can be a trailing closure? |
New Issue Checklist
Bug Report
It is sometimes handy to use anonymous closure as code grouping, e.g.:
When linted with
trailing_closure
enable, this incorrectly triggers a warning.Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 0.25.1If so, paste their relative paths and respective contents. No
xcode-select -p
)? 9.3echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use
swiftlint lint --path [file here] --no-cache --enable-all-rules
.The text was updated successfully, but these errors were encountered: