-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
EmptyFunctionBlock false positive: overridden function with comment in body #1684
Labels
Projects
Comments
I have the same. An example that triggers it: private interface AnimationEndListener : Animator.AnimatorListener {
override fun onAnimationStart(animation: Animator) {
// No-op
}
override fun onAnimationCancel(animation: Animator) {
// No-op
}
override fun onAnimationRepeat(animation: Animator) {
// No-op
}
} It looks like what the docs say: "This rule will not report functions overriding others.", is false, or more likely, the rule is bugged. @technoir42 I think that config option is for the opposite case, that is, |
cortinico
added a commit
to cortinico/detekt
that referenced
this issue
Jun 12, 2019
This rule had a bug in reporting functions with override and empty blocks (with or without comments). I'm fixing it and adding a couple of tests to make sure it works properly. Fixes detekt#1684
cortinico
added a commit
to cortinico/detekt
that referenced
this issue
Jun 13, 2019
This rule had a bug in reporting functions with override and empty blocks (with or without comments). I'm fixing it and adding a couple of tests to make sure it works properly. Fixes detekt#1684
arturbosch
pushed a commit
that referenced
this issue
Jun 17, 2019
* Fixed bug reporting false positives with EmptyFunctionBlock This rule had a bug in reporting functions with override and empty blocks (with or without comments). I'm fixing it and adding a couple of tests to make sure it works properly. Fixes #1684 * Clarify the documentation for the EmptyFunctionBlock rule * Running the fixed EmptyFunctionBlock on the codebase * Update EmptyFunctionBlockSpec to use hasLocationStrings * Introduce the `hasExactlyLocationStrings` assertion method.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
detekt 1.0.0-RC15
This gets reported by EmptyFunctionBlock as violation:
There is
ignoreOverriddenFunctions
but I don't want to ignore all overridden functions, just ones with a comment in their body.The text was updated successfully, but these errors were encountered: