-
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
Add multiple_closures_with_trailing_closure
rule
#1802
Add multiple_closures_with_trailing_closure
rule
#1802
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1802 +/- ##
==========================================
+ Coverage 88.24% 88.26% +0.02%
==========================================
Files 226 227 +1
Lines 11178 11218 +40
==========================================
+ Hits 9864 9902 +38
- Misses 1314 1316 +2
Continue to review full report at Codecov.
|
return [ | ||
StyleViolation(ruleDescription: type(of: self).description, | ||
severity: configuration.severity, | ||
location: Location(file: file, byteOffset: call.offset)) |
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.
Do you think it would be better if we added the violation to the trailing closure? For example:
foo.something(param1: { $0 }) ↓{ $0 + 1 }
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.
Makes sense to me. I had initially put the violation at the start of the function call because that's where it is for trailing_closure
, but I think the start of the trailing closure is more precise.
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.
Thanks for you contribution 💯
Could you please just rebase and generate the docs again?
Multiple Closures with Trailing Closure rule disallows trailing closure syntax when passing more than one closure argument to a function. Fixes #1801.
Rebased and docs regenerated. Note that I also added |
Thanks @erikstrottmann 🚀 |
As described in #1801, the Multiple Closures with Trailing Closure rule disallows trailing closure syntax when passing more than one closure argument to a function. This is my first PR for SwiftLint, so I’m certainly open to feedback.
Fixes #1801.