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. New lines rule(#748) #749

Merged
merged 24 commits into from
Feb 15, 2021
Merged

Bugfix. New lines rule(#748) #749

merged 24 commits into from
Feb 15, 2021

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Feb 4, 2021

Fixed bug mentioned in linked issue

This pull request closes #748

@aktsay6 aktsay6 added the bug Something isn't working label Feb 4, 2021
@aktsay6 aktsay6 requested review from petertrr and kentr0w February 4, 2021 12:15
@codecov
Copy link

codecov bot commented Feb 4, 2021

Codecov Report

Merging #749 (39387e4) into master (95434dd) will increase coverage by 0.73%.
The diff coverage is 99.62%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #749      +/-   ##
============================================
+ Coverage     79.80%   80.53%   +0.73%     
- Complexity     2035     2044       +9     
============================================
  Files            97       97              
  Lines          5106     5298     +192     
  Branches       1633     1638       +5     
============================================
+ Hits           4075     4267     +192     
  Misses          247      247              
  Partials        784      784              
Flag Coverage Δ Complexity Δ
unittests 80.53% <99.62%> (+0.73%) 0.00 <71.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 97.82% <ø> (ø) 12.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 81.48% <ø> (ø) 0.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/KotlinParser.kt 83.01% <ø> (ø) 17.00 <0.00> (ø)
...cqfn/diktat/ruleset/utils/PositionInTextLocator.kt 83.33% <ø> (ø) 0.00 <0.00> (ø)
...qfn/diktat/ruleset/utils/search/VariablesSearch.kt 86.20% <ø> (ø) 19.00 <0.00> (ø)
...eset/utils/search/VariablesWithAssignmentSearch.kt 71.42% <ø> (ø) 6.00 <0.00> (ø)
.../ruleset/utils/search/VariablesWithUsagesSearch.kt 91.66% <ø> (ø) 7.00 <0.00> (ø)
...iktat/ruleset/rules/chapter3/files/NewlinesRule.kt 82.11% <95.83%> (+0.99%) 138.00 <6.00> (+9.00)
...g/cqfn/diktat/ruleset/rules/chapter1/FileNaming.kt 86.95% <100.00%> (+1.95%) 9.00 <1.00> (ø)
.../diktat/ruleset/rules/chapter1/IdentifierNaming.kt 75.00% <100.00%> (+0.33%) 84.00 <1.00> (ø)
... and 64 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 95434dd...39387e4. Read the comment docs.

@aktsay6 aktsay6 marked this pull request as draft February 4, 2021 12:41
### What's done:
  * Fixed bug
@aktsay6 aktsay6 marked this pull request as ready for review February 4, 2021 12:50
@@ -305,9 +308,15 @@ class NewlinesRule(configRules: List<RulesConfig>) : DiktatRule("newlines", conf
return
}

if (node.elementType == VALUE_ARGUMENT_LIST && !node.hasParent(SUPER_TYPE_LIST)) {
// check that it is not listOf(1,2,3...)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// check that it is not listOf(1,2,3...)
// check that it is not function invocation, but only supertype constructor calls
Suggested change
// check that it is not listOf(1,2,3...)
// check that it is not listOf(1,2,3...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@@ -342,6 +352,25 @@ class NewlinesRule(configRules: List<RulesConfig>) : DiktatRule("newlines", conf
}
}

private fun handleFirstValueArgument(node: ASTNode) = node
Copy link
Member

Choose a reason for hiding this comment

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

It can be merged with handleFirstValueParameter with a couple of additional arguments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Merged

### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
# Conflicts:
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/kdoc/CommentsFormatting.kt
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
@aktsay6 aktsay6 marked this pull request as draft February 9, 2021 12:52
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
### What's done:
  * Fixed bugs
Copy link
Collaborator Author

@aktsay6 aktsay6 left a comment

Choose a reason for hiding this comment

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

@petertrr Please, rereview. There was a bug with function calls and it's arguments. Added tests on it. The change is in NewLinesRule file.

@aktsay6 aktsay6 marked this pull request as ready for review February 11, 2021 07:01
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.

@petertrr Please, rereview.

OK, lgtm

@aktsay6 aktsay6 merged commit 505b024 into master Feb 15, 2021
@aktsay6 aktsay6 deleted the bugfix/newlinesrule(#748) branch February 15, 2021 08:41
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.

Possible bug in NewLinesRule.
2 participants