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. Newline rule rbrace(#617) #650

Merged
merged 6 commits into from
Dec 21, 2020
Merged

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Dec 17, 2020

Handle of right brace case was added

This pull request closes #617

### What's done:
  * Logic began
### What's done:
  * Added case for right brace
@aktsay6 aktsay6 added the bug Something isn't working label Dec 17, 2020
@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

Merging #650 (e552c33) into master (21c0c59) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #650   +/-   ##
=========================================
  Coverage     78.91%   78.91%           
  Complexity     1789     1789           
=========================================
  Files            88       88           
  Lines          4696     4696           
  Branches       1506     1506           
=========================================
  Hits           3706     3706           
  Misses          298      298           
  Partials        692      692           
Flag Coverage Δ Complexity Δ
unittests 78.91% <100.00%> (ø) 0.00 <0.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...rg/cqfn/diktat/ruleset/rules/files/NewlinesRule.kt 80.35% <ø> (ø) 122.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 97.70% <100.00%> (ø) 9.00 <0.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 21c0c59...e552c33. Read the comment docs.

### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
@aktsay6 aktsay6 marked this pull request as ready for review December 17, 2020 13:27
@@ -113,11 +116,58 @@ class NewlinesRule(private val configRules: List<RulesConfig>) : Rule("newlines"
BLOCK -> handleLambdaBody(node)
RETURN -> handleReturnStatement(node)
SUPER_TYPE_LIST, VALUE_PARAMETER_LIST -> handleList(node)
RBRACE -> handleRightBrace(node)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be handled in BlockStructureBraces instead of NewlinesRule?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Completly forgot about it. Remade bugfix

### What's done:
  * Fixed bugs
@@ -144,6 +143,7 @@ class DiktatRuleSetProvider(private var diktatConfigFile: String = DIKTAT_ANALYS
::AvoidNestedFunctionsRule,
::ExtensionFunctionsSameNameRule,
// formatting: moving blocks, adding line breaks, indentations etc.
::BlockStructureBraces,
Copy link
Member

Choose a reason for hiding this comment

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

Wow, that turned out easy..

@aktsay6 aktsay6 merged commit f6786c2 into master Dec 21, 2020
@aktsay6 aktsay6 deleted the bugfix/newline-rule-rbrace(#617) branch December 21, 2020 14:00
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.

NewlinesRule doesn't add line break before }
2 participants