-
Notifications
You must be signed in to change notification settings - Fork 467
Only last step in kotlin {}
would apply
#2117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I don't think that's true. Both will run, it's just that |
I have something like this NettyChannelBuilder.forAddress(host, port)
.usePlaintext()
.apply {
}
.build() with NettyChannelBuilder.forAddress(host, port)
.usePlaintext()
.apply {
} .build() it will be formatted like NettyChannelBuilder.forAddress(host, port)
.usePlaintext()
.apply {
}.build() I am currently hacking it with below to get ktfmt applied first then ktlint kotlinGradle {
toggleOffOn()
target(ktTargets, ktsTargets)
ktfmt(libs.versions.ktfmt.asProvider().get()).kotlinlangStyle().configure {
it.setMaxWidth(120)
it.setRemoveUnusedImport(true)
}
}
kotlin {
toggleOffOn()
target(ktTargets, ktsTargets)
ktlint(libs.versions.ktlint.get())
.setEditorConfigPath(file(".editorconfig"))
.editorConfigOverride(
mapOf(
"ij_kotlin_allow_trailing_comma" to "true",
"ij_kotlin_allow_trailing_comma_on_call_site" to "true",
"ij_kotlin_packages_to_use_import_on_demand" to "*",
"ktlint_standard_property-naming" to "disabled",
"ktlint_standard_discouraged-comment-location" to "disabled",
),
)
}
tasks.named("spotlessKotlin").configure { dependsOn("spotlessKotlinGradle") }
tasks.named("spotlessKotlinApply").configure { dependsOn("spotlessKotlinGradleApply") }
tasks.named("spotlessKotlinGradle").configure { finalizedBy("spotlessKotlin") }
tasks.named("spotlessKotlinGradleApply").configure { finalizedBy("spotlessKotlinApply") } |
It looks you prefer the My advice is to remove the |
I actually put ktlint after ktfmt. I mostly want ktfmt but needs ktlint to redo some indentation. Now whatever order I put in |
This is the expected behavior. The steps aren't doing "checks", they |
If that's the case I would expect my workaround got same wiping, right? but it's not, so I think it's ktfmt not got applied |
Aha! Your workaround is doing two things:
|
Gotcha, I guess it's related to #1599 then, cuz I am not actually swapping orders, it's still ktfmt => ktlint 😂 . |
If you are submitting a bug, please include the following:
kotlin
block in gradle spotless configuration, it used to be applied in sequential order but seems now only the last step got applied.8.7
6.25.0
macOS 14.5
gradlew spotless[Apply/Check] --stacktrace
: N/AIf you're just submitting a feature request or question, no need for the above.
The text was updated successfully, but these errors were encountered: