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

WhiteSpaceRule after NewlinesRule #549

Merged
merged 3 commits into from
Nov 23, 2020
Merged

Conversation

kentr0w
Copy link
Collaborator

@kentr0w kentr0w commented Nov 18, 2020

What's done:

Changed rules
closes #484

### What's done:
   Changed rules
@kentr0w kentr0w added the bug Something isn't working label Nov 18, 2020
### What's done:
   Fixed bug and added tests
@codecov
Copy link

codecov bot commented Nov 18, 2020

Codecov Report

Merging #549 (d552dbb) into master (052bd9d) will increase coverage by 0.00%.
The diff coverage is 89.47%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #549   +/-   ##
=========================================
  Coverage     81.68%   81.69%           
- Complexity     1641     1665   +24     
=========================================
  Files            79       83    +4     
  Lines          4139     4211   +72     
  Branches       1307     1315    +8     
=========================================
+ Hits           3381     3440   +59     
- Misses          229      238    +9     
- Partials        529      533    +4     
Flag Coverage Δ Complexity Δ
unittests 81.69% <89.47%> (+<0.01%) 0.00 <7.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...at-rules/src/main/kotlin/generated/WarningNames.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...lin/org/cqfn/diktat/ruleset/rules/PackageNaming.kt 93.75% <33.33%> (-1.19%) 32.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 97.26% <100.00%> (ø) 8.00 <0.00> (ø)
...qfn/diktat/ruleset/rules/classes/SingleInitRule.kt 78.46% <100.00%> (+0.68%) 16.00 <0.00> (+6.00)
.../cqfn/diktat/ruleset/rules/files/BlankLinesRule.kt 100.00% <100.00%> (ø) 13.00 <7.00> (+1.00)
...rg/cqfn/diktat/ruleset/rules/files/NewlinesRule.kt 83.95% <100.00%> (+0.17%) 110.00 <0.00> (+6.00)
...g/cqfn/diktat/ruleset/rules/kdoc/KdocFormatting.kt 77.12% <100.00%> (-0.15%) 73.00 <0.00> (ø)
...rg/cqfn/diktat/plugin/gradle/DiktatGradlePlugin.kt 100.00% <0.00%> (ø) 2.00% <0.00%> (?%)
...n/org/cqfn/diktat/plugin/gradle/DiktatExtension.kt 100.00% <0.00%> (ø) 4.00% <0.00%> (?%)
...qfn/diktat/plugin/gradle/DiktatJavaExecTaskBase.kt 79.31% <0.00%> (ø) 5.00% <0.00%> (?%)
... and 1 more

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 0bf93cf...d552dbb. Read the comment docs.

Copy link
Member

@petertrr petertrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kentr0w kentr0w merged commit a1ccdbd into master Nov 23, 2020
@kentr0w kentr0w deleted the bugfix/whiteSpace-after-newlines branch November 23, 2020 14:30
@@ -297,7 +297,7 @@ class NewlinesRule(private val configRules: List<RulesConfig>) : Rule("newlines"
val colon = funNode.findChildByType(COLON)!!
val expression = node.findChildByType(RETURN_KEYWORD)!!.nextCodeSibling()!!
funNode.apply {
removeRange(colon, null)
removeRange(if (colon.treePrev.elementType == WHITE_SPACE) colon.treePrev else colon, null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was too easy! :)

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.

WhiteSpaceRule should be applied after NewlinesRule
3 participants