Skip to content

[Feature] Format Java with AOSP style (4-space indentation) #103

Closed

Description

@codegeek

Summary

Spotless formats Java with googleJavaFormat() (build.gradle.kts, the spotless { java { … } } block), set in the MVP commit dd8ef5f. Google Java Style uses 2-space indentation. Switch to AOSP style, which keeps the same formatter but indents with 4 spaces (8 for continuation lines), at the same 100-column limit.

Changes

  • build.gradle.kts: googleJavaFormat() becomes googleJavaFormat().aosp().
  • Run ./gradlew spotlessApply across the repo, in a commit that contains only the reformat.
  • Add that commit's hash to .git-blame-ignore-revs, so git blame and GitHub's blame view skip it. Mention git config blame.ignoreRevsFile .git-blame-ignore-revs in the README's development section.
  • Check that the constitution, AGENTS.md and .github/REVIEW_CHECKLIST.md don't describe the old style; update them if they do.

Sequencing

The reformat touches every Java file, so open branches conflict with it. Land it between feature PRs, not in the middle of one. A branch rebases onto it cleanly if it runs spotlessApply with the new config first, so that only real changes remain. Feature 014 (#100) is in progress, so do this before or after #100 merges, not during.

Acceptance

  • ./gradlew build is green, with spotlessCheck enforcing AOSP style in the pre-commit hook and CI.
  • The reformat commit changes formatting only, plus the one-line config change. Deeper indentation makes some lines wrap differently, so git diff -w won't be empty; the check is that the build and every test still pass with no other source edits.
  • .git-blame-ignore-revs lists the reformat commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions