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
CanBeNonNullable: fix false positives for parameterized types #4870
Conversation
...-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/CanBeNonNullableSpec.kt
Show resolved
Hide resolved
...-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/CanBeNonNullableSpec.kt
Show resolved
Hide resolved
CanBeNonNullable reports that properties of parameterized types can be marked as non-nullable even when this is impossible, just because the parameterized type is itself nullable (i.e. does not inherit from a non-nullable type). Instead, the rule should only report cases where a property is explicitly marked nullable but does not need to be.
Codecov Report
@@ Coverage Diff @@
## main #4870 +/- ##
============================================
+ Coverage 84.79% 84.81% +0.02%
- Complexity 3447 3453 +6
============================================
Files 492 492
Lines 11315 11330 +15
Branches 2083 2087 +4
============================================
+ Hits 9595 9610 +15
Misses 673 673
Partials 1047 1047
Continue to review full report at Codecov.
|
Hm, I forced pushed two additional tests and codecov is now complaining it's under the coverage target? 🤔 Did I do something wrong? I'm not as familiar with PRs in GitHub as other tools |
Yet another caveat on our CI configuration... We usualy don't pay attention to that (unless the number is near to 0). Probably we should do something about it to avoid this type of confusions. @schalkms What do you think we could do here? |
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
I guess you @BraisGabin and @dzirbel mean the two codecov CI runs.
Maybe, we could spend one or two sentences in the
|
Right, if the report can be inaccurate that all makes sense. In this case, coverage was above 80% initially (I believe, since all the checks had passed IIRC) and I force pushed two additional tests, after which coverage apparently dropped to 75%, so I wanted to double check that my PR method was correct (maybe I'd messed up rebases or something). Thanks both of you for the quick and helpful reviews on my PRs this weekend :) |
You are welcome 🤗 |
CanBeNonNullable reports that properties of parameterized types can be marked as non-nullable even when this is impossible, just because the parameterized type is itself nullable (i.e. does not inherit from a non-nullable type). Instead, the rule should only report cases where a property is explicitly marked nullable but does not need to be.