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
Handle @Suppress("UNCHECKED_CAST") for UnsafeCast rule #726
Comments
If the IntelliJ warning is enough for you, disabling the rule in your detekt configuration sounds like a good idea. |
Unfortunately that doesn't do it for me. IntelliJ mostly gives a warning when generics are involved, from what I gathered. The following code won't trigger any warning in IntelliJ, but are detected by the UnsafeCast rule :
|
Ah, I see. So its more about making sure the detekt rules also match the suppression rules of IntelliJ. We could add a List to each rule that can take in the names of "similar" rules in other static analysis suites. That way we could make this possible that only one |
Yep that'd be great ! |
I can take a look at implementing something that will make that work. WDYT @arturbosch @schalkms does something like this make sense? |
I makes sense. I think detekt has some rules where this mechanism can be applied. This means that this should be a generic functionality if possible. |
Yeah. I'll look into it later today/tomorrow
…On Tue, Feb 6, 2018, 16:17 schalkms ***@***.***> wrote:
I makes sense. I think detekt has some rules where this mechanism can be
applied. This means that this should be a *generic* functionality if
possible.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#726 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF4k0UrXxSyVnobU-wMfr3xNT4cZ6jR3ks5tSGzsgaJpZM4R7FGY>
.
|
Yep, surprisingly I thought about the same thing yesterday 👍 for this |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics. |
IntelliJ / Android Studio detect when a cast is unsafe and show a warning, which can be disabled using the
@Suppress("UNCHECKED_CAST")
annotation. It seems redundant to also add theUnsafeCast
rule, ending with some code annotated with@Suppress("UNCHECKED_CAST", "UnsafeCast")
The text was updated successfully, but these errors were encountered: