pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.19k stars 505 forks source link

Redundant suppression shown for PropertyName #2611

Closed Omico closed 6 months ago

Omico commented 6 months ago

image

Must add PropertyName otherwise will throw

rule: standard:property-naming
Property name should start with a lowercase letter and use camel case

ktlint version 1.2.1

Goooler commented 6 months ago

PropertyName is from IntelliJ, you can use ktlint:standard:property-naming for Ktlint instead.

Omico commented 6 months ago

PropertyName is from IntelliJ, you can use ktlint:standard:property-naming for Ktlint instead.

Thanks!!! I never know it can do this before.

paul-dingemans commented 6 months ago

To clarify above. When @Suppress("PropertyName") is used, this is respected by Ktlint and treated the same as @Suppress("ktlint:standard:property-naming"). But when you use @Suppress("PropertyName") where it is not supposed to be used, then Intellij IDEA complains about it. In such a case you should use the ktlint suppression.

paul-dingemans commented 6 months ago

Ktlint can not change the behavior of Intellij IDEA inspection that reports the redundant suppression.