-
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
Rule Request: multiline_arguments: Allow enforcing only after first closure #1896
Closed
2 tasks done
Labels
rule-request
Requests for a new rules.
Comments
ldiqual
changed the title
multiline_arguments: Allow closure argument on same line
multiline_arguments: Allow enforcing only after first closure
Oct 11, 2017
I think this is a great idea. Would it be hard to implement? I could give it a try. Where would I start? |
jpsim
changed the title
multiline_arguments: Allow enforcing only after first closure
Rule Request: multiline_arguments: Allow enforcing only after first closure
Nov 15, 2017
Shouldn't be too hard. Start in MultilineArgumentsRule.swift and MultilineArgumentsConfiguration.swift. |
any updates on this? |
maciesielka
added a commit
to maciesielka/SwiftLint
that referenced
this issue
Jul 5, 2018
…guments" rule as proposed in realm#1896. add tests.
maciesielka
added a commit
to maciesielka/SwiftLint
that referenced
this issue
Jul 5, 2018
…guments" rule as proposed in realm#1896. add tests.
Took a stab at adding this in #2281 |
Implemented by @maciesielka in #2281 🎉 |
dirtydanee
pushed a commit
to dirtydanee/SwiftLint
that referenced
this issue
Aug 14, 2018
…guments" rule as proposed in realm#1896. add tests.
sjavora
pushed a commit
to sjavora/SwiftLint
that referenced
this issue
Mar 9, 2019
…guments" rule as proposed in realm#1896. add tests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New Issue Checklist
Rule Request
My proposal is to add a new configuration for
multiline_arguments
that would allow enforcing the rule only after the first closure.For instance, I would like to handle this case:
However with the current defaults, I have to write it this way:
You would also be able to pass more inline arguments before
animations
.I believe that the animate + completion case above is common across iOS codebases and that the first style above is a common way to express it.
Ray Wenderlich's swift style guide passes
animations
on the same line: https://github.com/raywenderlich/swift-style-guide#closure-expressionsDoesn't trigger
Triggers
A name for such option could be:
allow_first_closure_on_same_line
only_enforce_after_first_closure
Hard to describe the intent in a generic way and I'd love input from you guys.
The option would be enabled by default for the
multiline_arguments
rule, since this is a common case as described above.The text was updated successfully, but these errors were encountered: