Skip to content

Add CI (lint + compile) + Spotless formatting, and apply one-time reformat#42

Merged
winrid merged 2 commits into
mainfrom
ci-and-format
Jul 1, 2026
Merged

Add CI (lint + compile) + Spotless formatting, and apply one-time reformat#42
winrid merged 2 commits into
mainfrom
ci-and-format

Conversation

@winrid

@winrid winrid commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Infrastructure - CI workflow, Spotless config, .editorconfig, lint baselines.
  2. One-time reformat - the mechanical formatting diff (no behavior changes).

CI (.github/workflows/ci.yml)

Runs on PRs and pushes to main, on JDK 17 (required by AGP 8.9):

  • spotlessCheck - formatting
  • lintDebug - Android lint (both modules)
  • assembleDebug - compile both modules

The com.fastcomments:core/client/pubsub artifacts 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)

  • Java - 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.
  • Kotlin - ktlint, configured via .editorconfig to the intellij_idea code style, with Compose-friendly naming rules (PascalCase @Composable functions, multi-component files).
  • Build scripts (*.gradle.kts) are formatted via ktlint too.

Developer workflow: ./gradlew spotlessApply to format, ./gradlew spotlessCheck to 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-module lint-baseline.xml snapshots 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 confirmed assembleDebug + the non-integration unit tests pass after the reformat, and that lint/compile succeed even without the gitignored TestConfig.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.

winrid added 2 commits June 30, 2026 16:57
- 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.
@winrid
winrid merged commit a4353bd into main Jul 1, 2026
1 check passed
@winrid
winrid deleted the ci-and-format branch July 1, 2026 00:04
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