-
-
Notifications
You must be signed in to change notification settings - Fork 794
Use config parameter for UseIfInsteadOfWhen rule #1987
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
Conversation
Deactivating the UseIfInsteadOfWhen rule had no effect, since the config parameter was missing for the rule. Fixes #1986
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 should be a hotfix and go into v1.1.1
I'll also add a test to prevent that from happening in the future.
This test checks if a valid config has been passed to all detekt rules. This prevents bugs like in #1986 form happening.
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.
Awesome!
Reason: Class.newInstance() bypasses exception checking; prefer getDeclaredConstructor().newInstance() http://errorprone.info/bugpattern/ClassNewInstance
should now also run on > Java8 |
BTW, the 1.1.0 tag in Git seems to be wrong now as it includes this fix, however the issue only occurred after the 1.1.0 release. |
Yeah, I forgot the github release tag. |
Well, yes, you can delete the wrong remote tag and push a new one under the same name, but of course that will not fix the local tags for anyone who fetched in between... |
* Use config parameter for UseIfInsteadOfWhen rule Deactivating the UseIfInsteadOfWhen rule had no effect, since the config parameter was missing for the rule. Fixes detekt#1986 * Add RuleProvider config test This test checks if a valid config has been passed to all detekt rules. This prevents bugs like in detekt#1986 form happening. * Don't use deprecated class.newInstance() for Java9 Reason: Class.newInstance() bypasses exception checking; prefer getDeclaredConstructor().newInstance() http://errorprone.info/bugpattern/ClassNewInstance
* Use config parameter for UseIfInsteadOfWhen rule Deactivating the UseIfInsteadOfWhen rule had no effect, since the config parameter was missing for the rule. Fixes detekt#1986 * Add RuleProvider config test This test checks if a valid config has been passed to all detekt rules. This prevents bugs like in detekt#1986 form happening. * Don't use deprecated class.newInstance() for Java9 Reason: Class.newInstance() bypasses exception checking; prefer getDeclaredConstructor().newInstance() http://errorprone.info/bugpattern/ClassNewInstance
Deactivating the UseIfInsteadOfWhen rule had no effect, since the config
parameter was missing for the rule.
Fixes #1986