-
-
Notifications
You must be signed in to change notification settings - Fork 821
IgnoredReturnValue: fix false negative when annotation is on the class #3979
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this contribution! I can't imagine how much bugs can fix this PR in our users code base.
chao2zhang
left a comment
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 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