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
Fixed bug reporting false positives with EmptyFunctionBlock #1690
Fixed bug reporting false positives with EmptyFunctionBlock #1690
Conversation
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 fix Nico! I think we can take the opportunity to improve the docs a bit further, while we're at it :)
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlock.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlock.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlockSpec.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlock.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlock.kt
Outdated
Show resolved
Hide resolved
Also the CI says you have conflicts :P |
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
Yeah I should update my master from time to time 😆 |
6ebe673
to
0560f0a
Compare
detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlockSpec.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlockSpec.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlockSpec.kt
Outdated
Show resolved
Hide resolved
detekt-rules/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/empty/EmptyFunctionBlockSpec.kt
Show resolved
Hide resolved
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 fix!
This should be good to go now imho |
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.
Nice! Thank you very much!
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.
LGTM! Thanks Nicola :)
Codecov Report
@@ Coverage Diff @@
## master #1690 +/- ##
============================================
- Coverage 79.81% 75.98% -3.84%
- Complexity 1594 1853 +259
============================================
Files 229 328 +99
Lines 4335 5521 +1186
Branches 829 1007 +178
============================================
+ Hits 3460 4195 +735
- Misses 428 790 +362
- Partials 447 536 +89
Continue to review full report at Codecov.
|
This rule (EmptyFunctionBlock) 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