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

ENUM_VALUE styles support: snakeCase/pascalCase #408

Merged
merged 6 commits into from
Oct 16, 2020
Merged

ENUM_VALUE styles support: snakeCase/pascalCase #408

merged 6 commits into from
Oct 16, 2020

Conversation

PhilipDukhov
Copy link
Contributor

Which rule and warnings did you add?

I've added config value for ENUM_VALUE.
Not everyone prefer snake case: https://discuss.kotlinlang.org/t/enum-constants-uppercase-or-camecase/13984
So there should be a possibility to choose what you prefer

Actions checklist

  • Implemented Rule, added Warnings
  • Added tests on checks
  • Added tests on fixers
  • Updated diktat-analysis.yml
  • Updated available-rules.md

Fixme

Not sure how can I use different warning for each case

@codecov
Copy link

codecov bot commented Oct 16, 2020

Codecov Report

Merging #408 into master will increase coverage by 0.02%.
The diff coverage is 90.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #408      +/-   ##
============================================
+ Coverage     82.59%   82.62%   +0.02%     
- Complexity     1340     1343       +3     
============================================
  Files            65       65              
  Lines          3281     3298      +17     
  Branches       1049     1055       +6     
============================================
+ Hits           2710     2725      +15     
  Misses          177      177              
- Partials        394      396       +2     
Flag Coverage Δ Complexity Δ
#unittests 82.62% <90.00%> (+0.02%) 1343.00 <0.00> (+3.00)

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

Impacted Files Coverage Δ Complexity Δ
...n/org/cqfn/diktat/ruleset/utils/StringCaseUtils.kt 82.08% <ø> (ø) 0.00 <0.00> (ø)
.../org/cqfn/diktat/ruleset/rules/IdentifierNaming.kt 82.30% <89.47%> (+0.89%) 76.00 <0.00> (+3.00)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 97.11% <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 906fe1c...d0571d5. Read the comment docs.

@orchestr7
Copy link
Member

orchestr7 commented Oct 16, 2020

Awesome, thanks!!! <3
Yeah, agree with you, it should be configurable. But are you really using enums not in UPPER_SNAKE_CASE?

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.

lgtm

@PhilipDukhov
Copy link
Contributor Author

Awesome, thanks!!! <3
Yeah, agree with you, it should be configurable. But are you really using enums not in UPPER_SNAKE_CASE?

Well, I came to Android development from iOS, and UPPER_SNAKE_CASE for me looks crazy 😁

@orchestr7 orchestr7 merged commit f57a88b into saveourtool:master Oct 16, 2020
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.

2 participants