Do you happen to know whether ktlint gradle plugin...
# ktlint
p
Do you happen to know whether ktlint gradle plugin is using ktlint 1.3.x? If it uses 1.2.x or older you might not be able to use latest versions of compose rules. I don't know by heart which is the last version that still can be used with ktlint 1.2 or older.
👍 1
r
the gradle plugin does use 1.3.1,
Copy code
version.set("1.3.1")
that solved the issue, thanks for the heads up it was using a different version prior to implicitly setting it
d
@Rudy Sulley are you able to share the config you used to get this going? I'm also working on a CMP project but can't get compose rules 0.4.5 to work with ktlint-gradle 12.1.1 / ktlint 1.3.1
r
Hello @daphillips
Copy code
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
        version.set("1.3.1")
    }
the above was the only change i had to make to get it to work followed the docs for the remaining
d
Thanks! I have it working now. Missed a couple of things that I'll drop here in case anyone else has trouble. 1. I also had to filter
***/generated/***
to prevent ktlint from picking up generated source files 2. I also missed in the docs the need to update the function naming rule:
Copy code
[*.{kt,kts}]
ktlint_function_naming_ignore_when_annotated_with = Composable