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

Compose rules not working in ktlint android studio plugin #216

Closed ashrafatef843 closed 4 months ago

ashrafatef843 commented 5 months ago

Compose rules doesn't work in ktlint android studio plugin.

Compose rule version jar: v0.3.13 Android studio version: Android Studio Hedgehog | 2023.1.1 Ktlint plugin version: 0.21.0

@Composable fun TestCompose() { }

Error: Function name should start with a lowercase letter (except factory methods) and use camel case (standard:function-naming)

mrmans0n commented 5 months ago

AFAIK there is nothing new in this version (comparing to 0.3.12) that should affect ktlint at all.

Version 0.3.12 updated ktlint to 1.2.1. Does it work with 0.3.12?

ashrafatef843 commented 5 months ago

@mrmans0n I tried v0.3.12 and it's not working also. Same error appears.

mrmans0n commented 5 months ago

And 0.3.11 ? Before our ktlint version bump?

The last ktlint plugin from the jetbrains plugins page says it supports ktlint 1.2.1 (like we do) since a month ago but their github releases haven't been updated, so that threw me off - and I thought they were targeting 1.1.1 still. But seems like we do target the same ktlint version.

If 0.3.11 doesn't work, I'd ask in their github as it doesn't seem like we changed much on our end for this to stop working 🤷

ashrafatef843 commented 5 months ago

I tried 0.3.11 also it's not working also. FYI I tried the gradle plugin by adding ktlint rules:

dependencies { ktlintRuleset "io.nlopez.compose.rules:ktlint:0.3.13" }

also the same error appears: message="Function name should start with a lowercase letter (except factory methods) and use camel case" source="standard:function-naming"

mrmans0n commented 5 months ago

That message isn't ours though, that's from the ktlint standard rules it seems ? It says so before the : character