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

Handling custom property accessors in formatting rules #337

Merged
merged 4 commits into from
Sep 29, 2020

Conversation

petertrr
Copy link
Member

What's done:

  • Updated IndentationRule
  • Updated ClassLikeStructuresOrderRule
  • Added tests

This pull request closes #320

### What's done:
* Updated IndentationRule
* Updated ClassLikeStructuresOrderRule
* Added tests
@codecov
Copy link

codecov bot commented Sep 29, 2020

Codecov Report

Merging #337 into master will increase coverage by 0.00%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #337   +/-   ##
=========================================
  Coverage     81.76%   81.76%           
- Complexity     1093     1102    +9     
=========================================
  Files            54       54           
  Lines          2786     2797   +11     
  Branches        884      890    +6     
=========================================
+ Hits           2278     2287    +9     
  Misses          183      183           
- Partials        325      327    +2     
Flag Coverage Δ Complexity Δ
#unittests 81.76% <85.71%> (+<0.01%) 1102.00 <0.00> (+9.00)

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

Impacted Files Coverage Δ Complexity Δ
...ktat/ruleset/rules/ClassLikeStructuresOrderRule.kt 82.05% <83.33%> (-0.39%) 39.00 <0.00> (+9.00) ⬇️
.../cqfn/diktat/ruleset/utils/indentation/Checkers.kt 72.85% <83.33%> (+0.98%) 0.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/files/IndentationRule.kt 89.33% <100.00%> (+0.14%) 20.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 8738dd1...4bc8081. Read the comment docs.

Copy link
Collaborator

@kentr0w kentr0w left a comment

Choose a reason for hiding this comment

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

LGTM

val numRequiredNewLines = 1 + (if (isBlankLineRequired) 1 else 0)
val actualNewLines = whiteSpaceBefore.text.count { it == '\n' }
// for some cases we do not check strict number of blank lines, but allow actual number to be less or equal
val isLessLinesAllowed = hasCustomAccessors
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can inline this variable

Copy link
Collaborator

@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.

lgtm

@petertrr petertrr merged commit 70d004b into master Sep 29, 2020
@petertrr petertrr deleted the feature/custom-getters-setters#320 branch September 29, 2020 13:16
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.

Incorrect analysis of properties with custom getters/setters
3 participants