Repository navigation
build: add Spotless with ktlint formatting checks - #1040
Merged
Merged
Conversation
Adds the Spotless Gradle plugin (8.9.0) with ktlint for Kotlin, using the same configuration as android-maps3d-samples, runs ./gradlew spotlessCheck in the lint workflow, and documents ./gradlew spotlessApply in CONTRIBUTING.md.
Output of ./gradlew spotlessApply, plus a few manual, behaviour-neutral fixes for violations ktlint cannot fix on its own (wildcard imports, long lines). No identifiers or public API were renamed.
| gradleMavenPublishPlugin = "0.37.0" | ||
| kotlin = "2.4.20" | ||
| kotlinxCoroutines = "1.11.0" | ||
| spotless = "8.9.0" |
Coverage (unit tests)Compared against
Line and branch coverage from unit test reports. History is recorded on the |
Contributor
dkhawk
approved these changes
Oct 14, 2026
This was referenced Oct 14, 2026
dkhawk
added a commit
that referenced
this pull request
Oct 14, 2026
- Apply Spotless ktlint 8.9.0 formatting across snippets module following rebase on #1040 - Align docs/CATALOG.md line ranges with spotless-formatted sources
This was referenced Oct 14, 2026
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.
Adds Spotless with ktlint so formatting is checked automatically on pull requests, instead of in review comments.
The configuration matches the one already used in android-maps3d-samples, so all the Maps Android repos format Kotlin the same way.
Changes
build: add Spotless with ktlint...: Spotless 8.9.0 in the version catalog, one rootspotless {}block covering every.ktfile,max_line_length = 120in.editorconfig, a./gradlew spotlessCheckstep in thelintjob oflint-report.yml, and a note inCONTRIBUTING.mdto run./gradlew spotlessApplybefore opening a PR.style: apply Spotless formatting: the output of./gradlew spotlessApply, plus a few manual, behaviour-neutral fixes (wildcard imports replaced, a few long@Deprecatedmessages split with+).Disabled ktlint rules, so this stays formatting-only:
property-namingandfilename(fixing them would mean renames). No public API is renamed inmaps-compose,maps-compose-utilsormaps-compose-widgets.Merging
Please use rebase and merge so the reformat stays a separate commit. After merging, I will add its SHA to
.git-blame-ignore-revsin a small follow-up, sogit blameskips it.Open PRs will likely need a rebase and a
./gradlew spotlessApplyafter this lands.Verification
./gradlew spotlessCheck assembleDebug testDebugUnitTest assembleDebugAndroidTestpass locally.