Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@t-kameyama
Copy link
Contributor

Fixes #3975

@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #3979 (12fbbed) into main (70c2c25) will increase coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
...arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt 83.33% <88.88%> (+3.33%) ⬆️
...osch/detekt/rules/empty/EmptyDefaultConstructor.kt 80.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 70c2c25...12fbbed. Read the comment docs.

@t-kameyama t-kameyama marked this pull request as draft July 26, 2021 08:55
@t-kameyama
Copy link
Contributor Author

@BraisGabin
Copy link
Member

BraisGabin commented Jul 26, 2021

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 @CanIgnoreReturnValue: https://github.com/assertj/assertj-core/pull/1534/files

It seems like error prone supports that annotation so maybe we should do it too.

Edit: Ups! Didn't saw your comment!

@t-kameyama t-kameyama force-pushed the issue_3975 branch 2 times, most recently from 2f81e66 to 54f8413 Compare July 27, 2021 03:40
@t-kameyama t-kameyama marked this pull request as ready for review July 27, 2021 05:27
Copy link
Member

@BraisGabin BraisGabin left a 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.

@BraisGabin BraisGabin added this to the 1.18.0 milestone Jul 27, 2021
Copy link
Member

@chao2zhang chao2zhang left a 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.

@t-kameyama t-kameyama requested a review from chao2zhang July 29, 2021 02:31
@BraisGabin BraisGabin merged commit dc4ab03 into detekt:main Aug 1, 2021
@t-kameyama t-kameyama deleted the issue_3975 branch August 1, 2021 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IgnoredReturnValue false negative when annotation is on the class

4 participants