-
-
Notifications
You must be signed in to change notification settings - Fork 794
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
Remove ignoreOverridden config from BooleanPropertyNaming etc. #5718
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5718 +/- ##
============================================
- Coverage 84.59% 84.59% -0.01%
+ Complexity 3790 3776 -14
============================================
Files 546 546
Lines 12918 12916 -2
Branches 2268 2268
============================================
- Hits 10928 10926 -2
Misses 861 861
Partials 1129 1129
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks for tidying up!
@BraisGabin do you want to review this, since you brought up this improvement? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! And sorry for the late review. If you could fix what I point out in my other comment we can merge this.
@@ -36,9 +36,6 @@ class BooleanPropertyNaming(config: Config = Config.empty) : Rule(config) { | |||
@Configuration("naming pattern") | |||
private val allowedPattern: Regex by config("^(is|has|are)", String::toRegex) | |||
|
|||
@Configuration("ignores properties that have the override modifier") | |||
private val ignoreOverridden: Boolean by config(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a "breaking change". It is not in the "normal way" but we treat the yaml configuration as part of our public API.
Instead of removing the property, just keep it and add it this annotation @Deprecated("This configuration is ignored")
(I'm not inspired with my descriptions feel free to improve it).
Other option is to add the deprecation atio.gitlab.arturbosch.detekt.generator.printer.writeMigratedRules
. This way we keep the code clean.
What bothe options does is to keep detekt-core/src/main/resources/deprecation.properties
up to date with old the deprecations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that's a clever way to manage deprecation. I have assumed that between the two ways of doing things you have stated, the first way is cleaner because the code is kept in sync with the deprecation.properties.
I just need to rebase this on the latest main
before we review again. I will ping later today when it is ready 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @BraisGabin I think this is ready for you to have another look at now
ca36280
to
c6c00e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detekt found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM
Fixes #5600 where it was agreed to remove
ignoreOverridden
from 5 rules:BooleanPropertyNaming
ConstructorParameterNaming
FunctionNaming
VariableNaming
FunctionParameterNaming