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

Implementation of recommendation 3.10 - local variables declaration #214

Merged
merged 10 commits into from
Sep 15, 2020

Conversation

petertrr
Copy link
Member

@petertrr petertrr commented Aug 31, 2020

Which rule and warnings did you add?

This pull request closes #155

Actions checklist

  • Implemented Rule, added Warnings
  • Added tests on checks
  • Updated rules-config.json
  • Updated available-rules.md

Fixme

A lot of limitations when working with AST only.

### What's done:
* Initial implementation
* Added tests on checkers
* Update rules-config.json and available-rules.md
* Edited diktat-kotlin-coding-style-guide-en.md
### What's done:
* Initial implementation
* More tests
* Introduced PsiUtils.kt
### What's done:
* Allow initialization by some selected methods
…ion-3.10#155

# Conflicts:
#	diktat-rules/src/main/kotlin/generated/WarningNames.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/constants/Warnings.kt
#	diktat-rules/src/main/resources/rules-config.json
#	info/available-rules.md
### What's done:
* More tests & refactoring
@codecov
Copy link

codecov bot commented Aug 31, 2020

Codecov Report

Merging #214 into master will decrease coverage by 0.27%.
The diff coverage is 75.70%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #214      +/-   ##
============================================
- Coverage     81.68%   81.41%   -0.28%     
- Complexity      927      956      +29     
============================================
  Files            48       50       +2     
  Lines          2403     2508     +105     
  Branches        742      780      +38     
============================================
+ Hits           1963     2042      +79     
- Misses          173      184      +11     
- Partials        267      282      +15     
Flag Coverage Δ Complexity Δ
#unittests 81.41% <75.70%> (-0.28%) 956.00 <32.00> (+29.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> (ø)
.../cqfn/diktat/ruleset/rules/files/BlankLinesRule.kt 100.00% <ø> (ø) 12.00 <0.00> (-3.00)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 84.24% <40.00%> (-1.48%) 0.00 <0.00> (ø)
...n/kotlin/org/cqfn/diktat/ruleset/utils/PsiUtils.kt 51.35% <51.35%> (ø) 0.00 <0.00> (?)
...at/ruleset/rules/identifiers/LocalVariablesRule.kt 92.06% <92.06%> (ø) 32.00 <32.00> (?)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 96.38% <100.00%> (+0.04%) 7.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 97.50% <100.00%> (+0.06%) 3.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 8055b2a...c35cf93. Read the comment docs.

@petertrr petertrr requested a review from orchestr7 August 31, 2020 14:22
Copy link
Member

@orchestr7 orchestr7 left a comment

Choose a reason for hiding this comment

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

generally looks good, small comments inside

…ion-3.10#155

# Conflicts:
#	diktat-rules/src/main/kotlin/generated/WarningNames.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/constants/Warnings.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt
#	diktat-rules/src/main/resources/rules-config.json
#	info/available-rules.md
### What's done:
* Fixes after review
### What's done:
* Fixes after review
@petertrr petertrr merged commit 5076f3d into master Sep 15, 2020
@petertrr petertrr deleted the feature/recommendation-3.10#155 branch September 15, 2020 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recommendation 3.10: Variables are declared close to the line where they are first used
2 participants