IgnoredReturnValue: fix false negative when annotation is on the class#3979
IgnoredReturnValue: fix false negative when annotation is on the class#3979BraisGabin merged 2 commits intodetekt:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3979 +/- ##
=========================================
Coverage 83.49% 83.50%
- Complexity 3160 3163 +3
=========================================
Files 458 458
Lines 9047 9052 +5
Branches 1759 1760 +1
=========================================
+ Hits 7554 7559 +5
- Misses 567 568 +1
+ Partials 926 925 -1
Continue to review full report at Codecov.
|
|
We need to take |
|
Nice and thanks for the PR! But now we have another problem: https://github.com/detekt/detekt/pull/3979/checks?check_run_id=3159666709#step:5:1836 And as it seems it was a false positive that AssertJ had and they fixed using It seems like error prone supports that annotation so maybe we should do it too. Edit: Ups! Didn't saw your comment! |
2f81e66 to
54f8413
Compare
BraisGabin
left a comment
There was a problem hiding this comment.
Thank you so much for this contribution! I can't imagine how much bugs can fix this PR in our users code base.
picklebento
left a comment
There was a problem hiding this comment.
Would you mind adding a test case when the annotation @CheckReturnValue is on the parent class but the method on a child class is invoked without checking the return value?
I do not have strong opinion whether we should report a violation or not, but documenting it in the test would help us clarify.
Fixes #3975