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
NoNameShadowing
false positive in kotlin-dsl
#5328
Comments
I assume that the lambda of |
I believe it does, but I think |
I see the problem... But I don't think detekt should take care of this strange behaviour were a compiler plugin is involved. If those functions would annotated with something we could use that to ignore them but that's not the case here. I think that here you should use a detekt.basePath?.let { b -> basePath = b } // NoNameShadowing |
I ended up specifying a name to get rid of the violation, but it could be annoying if there was a lot of them. If detekt used a compiler plugin, would it make it easier to avoid this issue (or would it solve it outright)? |
I imagine that with a compiler plugin this could be spotted. Closing for the reasons I wrote before. |
+2 I had the same issue with a different rules: just throwing my case here to maybe help the case of getting support for this in some form. I encountered two weird reports, one from (😅 It's really meta to be having a problem with setting up Detekt Gradle plugin and getting reports from Detekt on it.) |
Ran into this again with Deprecation and NoNameShadowing in a different projects that had a lot of violations. Was very annoying to address. |
Very excited for that. I'm ready to test 😅 |
I've been getting
NoNameShadowing
violations in a project that useskotlin-dsl
where the name being shadowed isimplicit lambda parameter 'it'
. I think it might be because of the lambda getting converted into anAction
because there's no otherit
in scope.The text was updated successfully, but these errors were encountered: