mrmans0n / compose-rules

Lint rules for ktlint/detekt aimed to contribute to a healthier usage of Compose. Actively maintained and evolved fork of the Twitter Compose rules.
https://mrmans0n.github.io/compose-rules
Other
543 stars 20 forks source link

Check `@Suppress("ComposableNaming")` annotation in compose:naming-check #225

Closed mxalbert1996 closed 4 months ago

mxalbert1996 commented 4 months ago

The same check to compose:naming-check is already available in Compose Runtime here, and can be suppressed with @Suppress("ComposableNaming"). The compose:naming-check rule should check for that suppression so that we don't need to suppress the same check with two different names.

mrmans0n commented 4 months ago

That is lint, while this is ktlint/detekt. You should probably completely disable the rule in one or other for your project if using both.

As per the renaming suggestion, that would basically force every user of this ruleset to update their configs (in detekt) or disabling lists (in ktlint), so that makes it a no go.

FWIW they having separate names is better so you can granularly control which one you want to disable anyway.

mxalbert1996 commented 4 months ago

No, I'm not suggesting renaming the rule at all. I'm suggesting the rule should check for @Suppress("ComposableNaming") additionally. FYI, ktlint is already doing similar thing in its official rule. Example

This rule can also be suppressed with the IntelliJ IDEA inspection suppression PropertyName or ConstPropertyName.

mrmans0n commented 4 months ago

Ah, gotcha.