Skip to content
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

Unused import not detected #3020

Closed
sschuberth opened this issue Aug 26, 2020 · 0 comments · Fixed by #3033
Closed

Unused import not detected #3020

sschuberth opened this issue Aug 26, 2020 · 0 comments · Fixed by #3033

Comments

@sschuberth
Copy link
Contributor

Expected Behavior

An unused import should be detected.

Observed Behavior

The unused import is not detected.

Steps to Reproduce

When using clikt, import

import com.github.ajalt.clikt.parameters.arguments.convert
import com.github.ajalt.clikt.parameters.options.convert

but use only com.github.ajalt.clikt.parameters.arguments.convert, then com.github.ajalt.clikt.parameters.options.convert is not detected as an unused import.

Context

See https://github.com/oss-review-toolkit/ort/blob/376555874ab7e46a95e894a2702e15b94326ee85/helper-cli/src/main/kotlin/commands/FormatRepositoryConfigurationCommand.kt#L24-L25

Your Environment

  • Version of detekt used: 1.12.0
  • Version of Gradle used (if applicable): 6.6.1
  • Operating System and version: Windows 10
  • Link to your project (if it's a public repository): https://github.com/oss-review-toolkit/ort
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Aug 26, 2020
Interestingly, these are not detected by detekt, see
detekt/detekt#3020

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Aug 27, 2020
Interestingly, these are not detected by detekt, see
detekt/detekt#3020

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
@arturbosch arturbosch added this to the 1.13.0 milestone Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants