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
Support disabling config validation via tooling spec #4937
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4937 +/- ##
============================================
- Coverage 84.83% 84.83% -0.01%
Complexity 3512 3512
============================================
Files 497 497
Lines 11549 11554 +5
Branches 2139 2141 +2
============================================
+ Hits 9798 9802 +4
Misses 686 686
- Partials 1065 1066 +1
Continue to review full report at Codecov.
|
@@ -41,7 +41,7 @@ internal fun CliArgs.createSpec(output: Appendable, error: Appendable): Processi | |||
|
|||
config { | |||
useDefaultConfig = args.buildUponDefaultConfig | |||
shouldValidateBeforeAnalysis = false | |||
shouldValidateBeforeAnalysis = 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.
🤔 Would it be better to have 3 values here? Enable/disabled/undefined? This way we don't need to use and
. If this is undefined the yml decides. Or we could just remove the yml value and make it only configurable by the cli.
Anyway, this is a step forward so LGTM.
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.
Three values would be better yes. That way the code says spec > config
.
Yes, removing it from the config would be optimal in a future breaking change.
That is also the case for many other configuration flags we now have in cli and removed from config.
What was the procedure in deprecating config properties? Deprecate it, implement a cli alternative and remove the config property after three minor releases?
I will change change the PR to support three values Enable/disabled/undefined
and in a later PR implement the cli flag and deprecate the config property.
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.
To deprecate you just need to add it inside detekt-core/src/main/resources/deprecation.properties
. And yes, we should keep it for at least 3 minor versions.
d637b24
to
49c9cb2
Compare
Disabling config validation is not yet supported in the cli via a flag.
The cli just set the spec value to false and
shouldValidateBeforeAnalysis
was never evaluated incore
.With this PR tools can programmatically disable config validation if needed.
For a usecase see detekt/detekt-intellij-plugin#179.