Stylianos Gakis
11/09/2023, 1:14 AMktlint_function_naming_ignore_when_annotated_with=Composable
in my editorconfig but it seems like it’s still failing to accept that for me.
If anyone has gotten this to work I’d love to hear about what I’ve done wrong here.mateusz.kwiecinski
11/09/2023, 8:56 AM./gradlew --stop
) after modifying .editorconfig
file?
There is a known issue where this line prevents it discovering file changes after failed builds (which are not considered incremental) 🙂Stylianos Gakis
11/09/2023, 9:01 AMresolutionStrategy.force
in the wrong place in my project and it’s not getting picked up properly. I tried in the settings.gradle.kts first, with the snippet exactly copied over from the docs
buildscript {
configurations.classpath {
resolutionStrategy {
force(
"com.pinterest.ktlint:ktlint-rule-engine:1.0.1",
"com.pinterest.ktlint:ktlint-rule-engine-core:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-core:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-checkstyle:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-json:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-html:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-plain:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-sarif:1.0.1",
"com.pinterest.ktlint:ktlint-ruleset-standard:1.0.1",
)
}
}
}
That didn’t help, and I tried adding it in the :app module’s build.gradle.kts, that didn’t work, also tried adding it to the convention plugin which applies kotlinter to each module, smth like:
class KtlintConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
val libs = the<LibrariesForLibs>()
with(pluginManager) {
apply(libs.plugins.kotlinter.get().pluginId)
}
configurations.all {
resolutionStrategy {
force(
"com.pinterest.ktlint:ktlint-rule-engine:1.0.1",
"com.pinterest.ktlint:ktlint-rule-engine-core:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-core:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-checkstyle:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-json:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-html:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-plain:1.0.1",
"com.pinterest.ktlint:ktlint-cli-reporter-sarif:1.0.1",
"com.pinterest.ktlint:ktlint-ruleset-standard:1.0.1",
)
}
}
// more stuff here...
}
}
}
Didn’t work either.
I am worried about this one in particular because it’s not something I’ve done before so I don’t know how to check if I am doing it right 😄Stylianos Gakis
11/09/2023, 9:07 AMmateusz.kwiecinski
11/09/2023, 9:10 AMsetting.gradle
is a different project, In convention plugin you're configuring configurations of the project KtlintConventionPlugin
has been applied to, not the buildscript
.
Putting the resolutionStrategy
to "regular" build.gradle file should do the trick, although I remembered modifying buildscript.classpath is tricky and has doesn't work in certain circumstances 👀mateusz.kwiecinski
11/09/2023, 9:11 AMHave you managed to bump to Kotlinter 4.x and Ktlint 1.x while also managing to suppress this false positive?I'm not using kotlinter anymore and I started maintaining my own fork https://github.com/usefulness/ktlint-gradle-plugin of it. You can give it a try if you want 🙂
Stylianos Gakis
11/09/2023, 9:15 AM