Repository navigation
Migrate from ktlint to ktfmt [CLF-722] - #200
Merged
Merged
Conversation
Replace the ktlint-gradle plugin, pinned to ktlint 0.38.1 (which cannot parse modern Kotlin syntax and has blocked upgrades), with ktfmt via the com.ncorti.ktfmt.gradle plugin using Google style. This matches the formatter already used by market and workflow-kotlin. - Apply ktfmt to all projects (including the root, so build scripts are formatted too) and configure googleStyle(). - Reformat all Kotlin sources and *.gradle.kts files with `./gradlew ktfmtFormat`. No functional changes; the build (tests + apiCheck) passes. - Update .editorconfig so IntelliJ's Kotlin formatter matches ktfmt's Google style, replacing the old ktlint-specific indentation workaround. - Remove the now-unneeded `ktlint-disable` comment in ComposeUiTest. - Document `./gradlew ktfmtFormat` / `ktfmtCheck` in CONTRIBUTING.md. `./gradlew build` already runs `check`, which now includes `ktfmtCheck`, so CI enforces formatting without any workflow changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Nov 4, 2026
joshfriend
approved these changes
Nov 4, 2026
zach-klippenstein
deleted the
zachklipp/radiography-ktlint-ktfmt-cfa2a9
branch
November 4, 2026 01:29
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.
Summary
Replaces the ktlint-gradle plugin with ktfmt (Google style) via ktfmt-gradle, matching the formatter already used by market and workflow-kotlin.
The ktlint version this build was pinned to (0.38.1) can't parse modern Kotlin syntax, which is what broke main in #196 and required #198 as a workaround. ktfmt tracks current Kotlin releases and removes that class of problem.
Changes
org.jlleitschuh.gradle.ktlintforcom.ncorti.ktfmt.gradle0.26.0 inlibs.versions.tomlandbuild.gradle.kts. The plugin is applied to all projects (including the root) withgoogleStyle(), so*.gradle.ktsfiles are formatted as well../gradlew ktfmtFormatacross the repo. These are the bulk of the diff and are pure formatting; no functional changes..editorconfig: replaced the old ktlint indentation workaround with settings that make IntelliJ's Kotlin formatter match ktfmt's Google style.ComposeUiTest.kt: dropped the now-unneededktlint-disable string-templatecomment.CONTRIBUTING.md: documents./gradlew ktfmtFormat/ktfmtCheckinstead of the Square IntelliJ code style.CI
No workflow changes needed.
./gradlew buildrunscheck, which now includesktfmtCheckfor every module, so unformatted code fails CI the same way ktlint did.Test plan
./gradlew buildpasses locally (compile, unit tests, Android lint,apiCheck,ktfmtCheck)./gradlew ktfmtFormatis idempotent after this changeLinear: CLF-722
🤖 Generated with Claude Code