Skip to content
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

Merged
merged 9 commits into from
Dec 1, 2020

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Nov 17, 2020

What's done:

  • Fixed bugs

This pull request closes #490

### What's done:
  * Fixed bugs
@aktsay6 aktsay6 added the bug Something isn't working label Nov 17, 2020
@aktsay6 aktsay6 requested review from petertrr and kentr0w November 17, 2020 13:51
# Conflicts:
#	diktat-rules/src/test/resources/test/smoke/src/main/kotlin/Example1Test.kt
@aktsay6 aktsay6 marked this pull request as draft November 23, 2020 08:33
### What's done:
  * Fixed bugs
@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #545 (a512f7a) into master (fefe2fd) will increase coverage by 0.00%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            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           
Flag Coverage Δ Complexity Δ
unittests 80.81% <80.00%> (+<0.01%) 0.00 <0.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
.../cqfn/diktat/ruleset/rules/files/WhiteSpaceRule.kt 79.16% <80.00%> (+0.29%) 128.00 <0.00> (+2.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fefe2fd...a512f7a. Read the comment docs.

@aktsay6 aktsay6 marked this pull request as ready for review November 23, 2020 09:05
# 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
@aktsay6 aktsay6 requested a review from petertrr November 30, 2020 12:11
@@ -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
Copy link
Member

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
@aktsay6 aktsay6 merged commit 078b6d7 into master Dec 1, 2020
@aktsay6 aktsay6 deleted the bugfix/lambda-forced-to-be-on-same-line(#490) branch December 1, 2020 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lambda passed as an argument is forced to be on the same line as the previous argument
2 participants