format/configured/kotlin
A formatter is configured
Implements format/configured for kotlin.
| Severity | warning |
| Tiers | 1, 2 |
| Stacks | kotlin |
| Scope | each |
| Kind | outcome |
| Source | library v0.7.0 |
| Selected by | fleetlint-recommended@v0.7.0 |
Requirement
A formatter is wired into the Gradle build (this build, a parent build or a convention plugin): Spotless, ktlint or ktfmt, or one runs in a hook, the task runner or CI. Another formatter is added with accept:.
Why
Without one formatter every editor reformats differently and diffs fill with whitespace churn that hides the real change.
Fix
Add Spotless with ktlint (or ktfmt) to the Gradle build and run spotlessCheck in the hooks.
Agent instruction: Add the Spotless Gradle plugin with ktlint() for Kotlin sources, spotlessCheck to the lint target and a hook; reformat in a separate commit.
A finding of this rule points at the file (["build.gradle.kts", "build.gradle"].filter(f, file(f)) + ["build.gradle.kts"])[0] yields.
Sources
- https://fleetlint.org/baseline/#static-analysis (convention)
- https://kotlinlang.org/docs/coding-conventions.html (guidance, Formatting)
- https://github.com/diffplug/spotless (spec)
- https://fleetlint.org/stacks/#kotlin-jvm–android
Generated by fleetlint docs from catalog v0.7.0.