build: enforce Kotlin quality with ktlint + detekt guardrails - #83
Merged
Conversation
Add ktlint (usefulness gradle plugin 0.14.0, engine 1.8.0) alongside the existing detekt setup as a binding, machine-checked quality gate. - ktlint owns formatting/imports (.editorconfig, intellij_idea style); detekt owns semantic/structural analysis. Overlapping detekt style rules (WildcardImport, UnusedImports) are disabled to avoid double reporting. - Both wired into `check`/`build`; CI runs `lintKotlin detekt --continue` (collects all findings) and lefthook gains a `lintKotlin` pre-push step. - Fix all 588 initial ktlint findings via formatKotlin (auto-fixable, behavior-preserving); detekt already clean. No baseline, no silent suppressions. Scoped exceptions: ktor wildcard imports, generated runtime fixture, no hard line-length limit.
emaarco
enabled auto-merge (squash)
August 13, 2026 13:34
Contributor
|
Test Coverage
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Introduces ktlint as a binding, machine-checked Kotlin quality gate alongside the existing detekt setup, and fixes all resulting findings.
io.github.usefulness.ktlint-gradle-plugin0.14.0, engine 1.8.0) owns formatting + import hygiene via.editorconfig(intellij_ideastyle). Chosen over the JLLeitschuh plugin because that one has an open Gradle-9 configuration-cache failure and this repo runs with the config cache on.WildcardImport,UnusedImports) are disabled so findings aren't double-reported.check/build. CI runs./gradlew lintKotlin detekt --continue(so a single run surfaces every finding across all modules/both tools) thenbuild; the lefthookpre-pushhook gains alintKotlinstep.Findings
formatKotlin. Behavior-preserving: full build, all module tests, and coverage verification stay green.Guardrail policy
No detekt baseline, no blanket excludes, no
@Suppressadded. The only scoped, documented exceptions: ktor wildcard imports (io.ktor.**), the generated runtime test fixture, and no hard line-length limit (mirrors the pre-existing detekt decision).