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
UnsafeCallOnNullableType not reporting !! usage #2036
Comments
The behaviour of the rule has changed to now require type resolution, which means if you're running detekt without type resolution (not passing a classpath) then it won't run the rule. We need docs for this and have an issue open already to cover that. If you're actually running detekt with type resolution and the rule is still not picking up this case then we'll need to look more closely at the problem. |
By passing a classpath you mean running detekt with |
One way would be running |
I ran the task Could you please clarify how should I do this? Is there a way to declare it inside my detekt block like |
Gradle creates tasks for each source set but currently only on Kotlin JVM projects, is it maybe an Android, native or JS project? We definitely need docs for this so probably creating those is the action we need to take to resolve this, see #1943 |
It's an Android project. If there's something else I can help, please let me know. |
Yeah we're not generating required Gradle tasks for Android yet. It's on my to do list; I'll work on it next since there's a clear need. |
The required Gradle tasks for Android are described as a todo in another issue. Therefore, I’ll close this. |
@schalkms Can you link the issue with this TODO? |
Link #2259 |
Expected Behavior
UnsafeCallOnNullableType
rule should report usages of!!
as an unsafe call on nullable type.Observed Behavior
UnsafeCallOnNullableType
rule isn't reporting!!
as an unsafe call on nullable type after 1.1.0 update.Steps to Reproduce
When running the following test:
The test won't pass if the
UnsafeCallOnNullableType
rule after f80fe60 commit is used but, if you remove the 3 lines added to the rule by the linked commit or use version1.0.1
, it will pass.Your Environment
The text was updated successfully, but these errors were encountered: