-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
New rule: disallow to cast to nullable type #3497
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3497 +/- ##
============================================
- Coverage 79.73% 77.57% -2.16%
+ Complexity 2869 2808 -61
============================================
Files 461 462 +1
Lines 8668 8683 +15
Branches 1676 1679 +3
============================================
- Hits 6911 6736 -175
- Misses 845 1040 +195
+ Partials 912 907 -5 Continue to review full report at Codecov.
|
...-errorprone/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt
Outdated
Show resolved
Hide resolved
…etekt/rules/bugs/CastToNullableTypeSpec.kt Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
Sorry, but I still don't see the value of this rule. And why is OK if the initial type is not nullable. I'd like to know what the other maintainers think about it. |
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.
I think the rule is valuable. To be honest I never really wrote a cast to a nullable type (as String?
) and I've always used the as?
variant, but I understand that it could be useful to detect them.
...-errorprone/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt
Outdated
Show resolved
Hide resolved
...-errorprone/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/CastToNullableTypeSpec.kt
Outdated
Show resolved
Hide resolved
…etekt/rules/bugs/CastToNullableTypeSpec.kt Co-authored-by: Nicola Corti <corti.nico@gmail.com>
…etekt/rules/bugs/CastToNullableTypeSpec.kt Co-authored-by: Nicola Corti <corti.nico@gmail.com>
Fixes #3479