-
Notifications
You must be signed in to change notification settings - Fork 39
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
Properly format expressions wrapped *before* a binary operator #1486
Properly format expressions wrapped *before* a binary operator #1486
Conversation
### What's done: * Now, the indentation in binary expressions wrapped *before* a binary operator or an infix function is also controlled with `extendedIndentAfterOperators`. * The above is also true for `as` and `as?` operators. * The only exclusion is the Elvis operator (`?:`). * Fixes #1340.
Codecov Report
@@ Coverage Diff @@
## master #1486 +/- ##
============================================
- Coverage 82.96% 82.96% -0.01%
Complexity 2579 2579
============================================
Files 111 111
Lines 7708 7712 +4
Branches 2111 2114 +3
============================================
+ Hits 6395 6398 +3
Misses 418 418
- Partials 895 896 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -605,6 +605,29 @@ internal object IndentationRuleTestResources { | |||
| 2 to | |||
| 3)) | |||
""".trimMargin(), | |||
|
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.
Actually - I suggest to split resources - we don't need to have huge unit tests that have complex logic (especially when warnings are far away from the code)
softly.assertThat(lintResult(code, customConfig.asRulesConfigList())) | ||
.describedAs("lint result for ${code.describe()}") | ||
.isNotEmpty | ||
.hasSizeBetween(1, 5).allSatisfy(Consumer { lintError -> |
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.
expecting from 1 to 5 warnings :)
What's done:
or an infix function is also controlled with
extendedIndentAfterOperators
.as
andas?
operators.?:
).WRONG_INDENTATION
:extendedIndentAfterOperators
ignored if lines are wrapped before a binary operator or an infix function #1340.