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
UnusedPrivateProperty does not detect unused property named "logger" #7222
Comments
Below TC is passing though @Test
fun `does report private logger property in top level`() {
val code = """
private val logger = 2
""".trimIndent()
assertThat(subject.lintWithContext(env, code))
.hasSize(1)
} is your type resolution set properly? |
Hi, I've tried to run 'detektMain' wich gave me a lot of new findings but the unused logger property was still ignored. It must have something to do with the 'KotlinLogging.logger {}'. |
Expected Behavior
detekt should find unused properties for which no exception is defined.
Observed Behavior
detekt does not find unused properties named "logger".
Steps to Reproduce
Context
The documentation statesthe default allowed values are: allowedNames (default: '_|ignored|expected|serialVersionUID') - "logger" is not listed here.
We also have no exceptions in our config for that rule defined:
Your Environment
Gradle 8.6
Build time: 2024-02-02 16:47:16 UTC
Revision: d55c486870a0dc6f6278f53d21381396d0741c6e
Kotlin: 1.9.20
Groovy: 3.0.17
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM: 17.0.10 (Private Build 17.0.10+7-Ubuntu-122.04.1)
OS: Linux 6.5.0-28-generic amd64
The text was updated successfully, but these errors were encountered: