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. False-positive LOCAL_VARIABLE_EARLY_DECLARATION #535

Merged

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Nov 17, 2020

What's done:

  • Fixed bugs

This pull request closes #488

@aktsay6 aktsay6 added the bug Something isn't working label Nov 17, 2020
@codecov
Copy link

codecov bot commented Nov 17, 2020

Codecov Report

Merging #535 (4d01cc0) into master (052bd9d) will increase coverage by 0.05%.
The diff coverage is 90.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #535      +/-   ##
============================================
+ Coverage     81.68%   81.73%   +0.05%     
- Complexity     1641     1665      +24     
============================================
  Files            79       83       +4     
  Lines          4139     4211      +72     
  Branches       1307     1315       +8     
============================================
+ Hits           3381     3442      +61     
- Misses          229      237       +8     
- Partials        529      532       +3     
Flag Coverage Δ Complexity Δ
unittests 81.73% <90.00%> (+0.05%) 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> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/ASTConstants.kt 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...main/kotlin/org/cqfn/diktat/plugin/gradle/Utils.kt 62.50% <0.00%> (ø) 0.00% <0.00%> (?%)
...n/org/cqfn/diktat/plugin/gradle/DiktatExtension.kt 100.00% <0.00%> (ø) 4.00% <0.00%> (?%)
... and 3 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 d8651d2...adabd0d. Read the comment docs.

@aktsay6 aktsay6 marked this pull request as ready for review November 17, 2020 08:27
@aktsay6
Copy link
Collaborator Author

aktsay6 commented Nov 17, 2020

Can't reproduce this bug, so added test, that checks it

"""
|class Example {
| fun some() {
| val code = ${"\"\"\" class Some {\n \t\t fun for() {} \n \t} \"\"\".trimIndent()"}
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need ${} here? Also, this is not exactly example from the issue, there are some different newlines there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is used to insert triple quotes

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.

So, after all, the issue isn't reproducible any more? Please write about it in the issue discussion (to not forget later).

…-declaration(#488)

# 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
@aktsay6 aktsay6 merged commit cd83754 into master Nov 23, 2020
@aktsay6 aktsay6 deleted the bugfix/false-positive-local-variable-early-declaration(#488) branch November 23, 2020 16:20
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.

False-positive LOCAL_VARIABLE_EARLY_DECLARATION
2 participants