We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The bug you're experiencing might have already be reported! Please search in the issues before creating one.
Not detecting Unused Import
It is better to fix this code, but if you delete the import according to lint, a build error will occur.
import com.foo.psi.Sealed import com.foo.psi.Sealed.SubClass fun main() { listOf<Sealed>() Sealed.SubClass() SubClass() }
We can check this by adding this test.
https://github.com/pinterest/ktlint/blob/master/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/NoUnusedImportsRuleTest.kt#L9
@Test fun `only redundant sealed sub class imports should be removed`() { assertThat( NoUnusedImportsRule().lint( """ import com.foo.psi.Sealed import com.foo.psi.Sealed.SubClass fun main() { listOf<Sealed>() Sealed.SubClass() SubClass() } """.trimIndent() ) ).isEmpty() } }
Adding test
Probably happens regardless of environment
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The bug you're experiencing might have already be reported!
Please search in the issues before creating one.
Expected Behavior
Not detecting Unused Import
Observed Behavior
It is better to fix this code, but if you delete the import according to lint, a build error will occur.
We can check this by adding this test.
https://github.com/pinterest/ktlint/blob/master/ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/NoUnusedImportsRuleTest.kt#L9
Steps to Reproduce
Adding test
Your Environment
Probably happens regardless of environment
The text was updated successfully, but these errors were encountered: