Add CI (lint + compile) + Spotless formatting, and apply one-time reformat#42
Merged
Conversation
- GitHub Actions workflow (.github/workflows/ci.yml) running on PRs and
pushes to main: Spotless formatting check, Android lint, and a debug
compile (assembleDebug) for both modules. JDK 17 for AGP 8.9. The
com.fastcomments dependencies are public-read on Repsy, so no secrets
are required to build.
- Spotless (com.diffplug.spotless) wired in the root build:
- Java: palantir-java-format (4-space, IntelliJ-like) + unused-import
removal, trailing-whitespace trim, final newline.
- Kotlin: ktlint, configured via .editorconfig to the intellij_idea
code style (with Compose-friendly naming rules).
Run `./gradlew spotlessApply` to format, `spotlessCheck` to verify.
- Android lint baselines (app + sdk) so CI fails only on newly introduced
issues rather than the ~2300 pre-existing ones (mostly the SDK's
resourcePrefix naming).
Mechanical, no behavior changes: 4-space indentation, conventional wrapping, normalized imports, trailing-whitespace and final-newline fixes across all Java and Kotlin sources. Verified with assembleDebug and the non-integration unit tests.
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
Adds GitHub Actions CI for linting and compile checks, wires up Spotless for ongoing formatting enforcement, and applies a one-time reformat of the whole codebase to formatting rules close to JetBrains IDEA defaults.
Two commits for reviewability:
.editorconfig, lint baselines.CI (
.github/workflows/ci.yml)Runs on PRs and pushes to
main, on JDK 17 (required by AGP 8.9):spotlessCheck- formattinglintDebug- Android lint (both modules)assembleDebug- compile both modulesThe
com.fastcomments:core/client/pubsubartifacts are public-read on Repsy, so no secrets are required for CI to build (Repsy credentials are still forwarded from secrets if present, but are optional).Formatting (Spotless)
palantir-java-format(4-space indentation, conventional wrapping - the closest mainstream auto-formatter to IntelliJ's Java defaults), plus unused-import removal, trailing-whitespace trim, and final-newline.ktlint, configured via.editorconfigto theintellij_ideacode style, with Compose-friendly naming rules (PascalCase@Composablefunctions, multi-component files).*.gradle.kts) are formatted viaktlinttoo.Developer workflow:
./gradlew spotlessApplyto format,./gradlew spotlessCheckto verify (also enforced in CI).Lint baselines
Android lint surfaced ~2300 pre-existing issues (mostly the SDK's
resourcePrefix = "fastcomments_"naming). Rather than rename everything, I added per-modulelint-baseline.xmlsnapshots so CI fails only on newly introduced issues while keeping all checks active for new code.Verification
Locally ran the exact CI task set together -
./gradlew spotlessCheck lintDebug assembleDebug- all green. Also confirmedassembleDebug+ the non-integration unit tests pass after the reformat, and that lint/compile succeed even without the gitignoredTestConfig.java(so CI doesn't need it).Note
The reformat commit touches 109 files; it's purely mechanical. Best reviewed commit-by-commit, with the bulk diff viewed ignoring whitespace.