-
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
Bugfix. Lambda passed as an argument is forced to be on the same line as the previous argument #545
Conversation
### What's done: * Fixed bugs
# Conflicts: # diktat-rules/src/test/resources/test/smoke/src/main/kotlin/Example1Test.kt
### What's done: * Fixed bugs
Codecov Report
@@ Coverage Diff @@
## master #545 +/- ##
=========================================
Coverage 80.80% 80.81%
- Complexity 1709 1712 +3
=========================================
Files 87 87
Lines 4381 4383 +2
Branches 1349 1349
=========================================
+ Hits 3540 3542 +2
Misses 298 298
Partials 543 543
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
diktat-rules/src/test/resources/test/smoke/src/main/kotlin/Example1Test.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/files/WhiteSpaceRule.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # diktat-rules/src/test/resources/test/smoke/src/main/kotlin/Example4Expected.kt # diktat-rules/src/test/resources/test/smoke/src/main/kotlin/Example4Test.kt
### What's done: * Fixed bugs
### What's done: * Fixed bugs
@@ -193,6 +193,19 @@ class WhiteSpaceRule(private val configRules: List<RulesConfig>) : Rule("horizon | |||
it[2].prevSibling { prevNode -> prevNode.elementType == COMMA } == null | |||
} | |||
?: false | |||
val isLambda = node |
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.
Some logic should be reused between isLambdaAsArgument
and isLambda
. Or maybe you could check whether the lambda is a frist argument inside if (isFromLambdaAsArgument)
.
### What's done: * Fixed bugs
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/files/WhiteSpaceRule.kt
Outdated
Show resolved
Hide resolved
diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/files/WhiteSpaceRule.kt
Outdated
Show resolved
Hide resolved
### What's done: * Fixed bugs
What's done:
This pull request closes #490