Skip to content

build: enforce Kotlin quality with ktlint + detekt guardrails - #83

Merged
emaarco merged 1 commit into
mainfrom
emaarco/skopje
Aug 13, 2026
Merged

build: enforce Kotlin quality with ktlint + detekt guardrails#83
emaarco merged 1 commit into
mainfrom
emaarco/skopje

Conversation

@emaarco

@emaarco emaarco commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

Introduces ktlint as a binding, machine-checked Kotlin quality gate alongside the existing detekt setup, and fixes all resulting findings.

  • ktlint (io.github.usefulness.ktlint-gradle-plugin 0.14.0, engine 1.8.0) owns formatting + import hygiene via .editorconfig (intellij_idea style). 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.
  • detekt keeps ownership of semantic/structural analysis. Overlapping style rules (WildcardImport, UnusedImports) are disabled so findings aren't double-reported.
  • Both tools are wired into check/build. CI runs ./gradlew lintKotlin detekt --continue (so a single run surfaces every finding across all modules/both tools) then build; the lefthook pre-push hook gains a lintKotlin step.

Findings

  • detekt: 0 (already clean).
  • ktlint: 588 findings across 149 files on first run — all auto-fixable and fixed with formatKotlin. Behavior-preserving: full build, all module tests, and coverage verification stay green.

Guardrail policy

No detekt baseline, no blanket excludes, no @Suppress added. 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).

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
emaarco enabled auto-merge (squash) August 13, 2026 13:34
@emaarco emaarco self-assigned this Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Test Coverage

Module Line Coverage
bpmn-to-code-core 97.6% (2317/2373 lines)
bpmn-to-code-gradle 25.7% (29/113 lines)
bpmn-to-code-maven 62.2% (28/45 lines)
bpmn-to-code-web 95.6% (196/205 lines)
bpmn-to-code-testing 95.5% (168/176 lines)
bpmn-to-code-runtime 99.0% (96/97 lines)

@emaarco
emaarco merged commit 6c946a5 into main Aug 13, 2026
5 checks passed
@emaarco
emaarco deleted the emaarco/skopje branch August 13, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant