8000 google-java-format: add 1.37.0 by bryan-minimal · Pull Request #905 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content
905
Merged
bryan-minimal merged 4 commits into
mainfrom
add-google-java-format
Oct 22, 2026
Merged

bryan-minimal merged 4 commits into
mainfrom
add-google-java-format

Conversation

@bryan-minimal
@bryan-minimal bryan-minimal commented Oct 16, 2026 •
Copy link
Copy Markdown
Member

What

Adds google-java-format 1.37.0, the de-facto Java formatter. This is the first Tier 1 item in the #899 Java loadout checklist.

  • Artifact: the upstream google-java-format-1.37.0-all-deps.jar from GitHub releases. It is installed at usr/share/google-java-format/google-java-format.jar and run on our jdk through a /usr/bin/google-java-format wrapper (exec java -jar …).
  • Why the jar and not the native binaries: upstream also ships GraalVM native-image binaries for linux-x86-64 and linux-arm64. The jar is one architecture-independent artifact, so there is one sha256 and no match target dispatch, and it runs on the same JDK as the rest of the Java tooling. The jar's manifest already carries the Add-Exports: jdk.compiler/com.sun.tools.javac.* entries, so plain java -jar works without the --add-exports flags the README lists for other launch modes. It needs a full JDK (the jdk.compiler module) at version 21 or later (class file version 65); our jdk is 25 (Temurin, since jdk: current LTS (meta over jdk-25); add jdk-25 (Temurin 25) and jdk-21 (Temurin 21) #897), which satisfies it.
  • Prebuilt, not built from source: upstream builds with a Maven reactor that resolves dependencies from Maven Central at build time. This is the same tradeoff maven, gradle and jdtls make. Recorded as binary_from.
  • License: Apache-2.0.
  • Version checking / CVE identity: source_provenance = GithubRepo google/google-java-format. Tags are v<version>.
  • sha256: 834b2a0c…62f7a, computed locally and matching the GitHub release asset digest.

Tests (Standalone)

  • format formats class Hello{void f(){int x=1;if(x>0){x++;}}} and runs diff -u against the exact Google-style output.
  • check_mode runs --dry-run --set-exit-if-changed. It must exit non-zero on an unformatted file and zero on a formatted one.

Verified

Built in a pkgbuild session (arm64) with min package build --rebuild. min check --packages google-java-format passed every checker, including standalone tests, output types valid and missing runtime_deps. Negative control: changing the expected output to x-- failed format with the real diff (-x-- / +x++).

amd64 is not separately run locally; it is left to CI.

Refs #899

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added Google Java Format 1.37.0, making the Java formatter available with its required runtime components.
    • The formatter can check whether files need formatting and return a failure status when they do.

JVM tool for the Java loadout (#899): upstream release artifact run on
our jdk through a /usr/bin wrapper, with Standalone tests that run the
tool on a small real input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner October 16, 2026 20:31
@coderabbitai
coderabbitai Bot commented Oct 16, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: gominimal/pkgs/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: be96ec0b-eca4-4011-98a7-39ead05a043d
📥 Commits

Reviewing files that changed from the base of the PR and between e39315f and 9ed3be2.

📒 Files selected for processing: 2
  • packages/google-java-format/build.ncl
  • packages/google-java-format/build.sh

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

📝 Walkthrough

Adds a package definition for google-java-format 1.37.0. The package fetches a checksum-pinned JAR, installs a Java wrapper, declares runtime dependencies and package metadata, and includes standalone formatter checks.

Changes: google-java-format package

8000
Layer / File(s) Summary
Package build and validation
packages/google-java-format/build.ncl, packages/google-java-format/build.sh
The build specification defines the upstream JAR and checksum, runtime dependencies, package metadata, and output files. The build script installs the JAR and an executable wrapper that forwards arguments to Java. Standalone tests compare formatted output and check --dry-run --set-exit-if-changed results.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 9ed3b

This adds a new google-java-format package with a wrapper script and tests. It has no identified merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the package and the added version, which matches the main change in the pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean. The sha256 matches, the manifest carries the Add-Exports entries so plain java -jar works, and the tests check exact formatted output and --set-exit-if-changed.

  • Nit, build.sh:8: cp leaves the jar's mode to however it was fetched. install -m 0644, as in #922 and #923, makes it deterministic and consistent.

Holding approval only on the shared policy question: whether JVM tools may ship the upstream jar (with binary_from) instead of building from source, as AGENTS.md otherwise requires. This is being decided once for the whole batch.


Generated by Claude Code

bryan-minimal and others added 2 commits October 21, 2026 19:06
Review nit: cp left the jar mode to however it was fetched; install -m
0644 makes it deterministic, as #922 and #923 do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
Copy link
Copy Markdown
Member Author

Thanks @norrietaylor.

bash -n, nickel format --check and mip dump --packages (amd64) are clean after the merge.

🤖 Generated with Claude Code

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving under #970. The install -m 0644 nit is fixed and the branch is past #897. Please merge after #970.


Generated by Claude Code

@bryan-minimal
bryan-minimal added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 1689d51 Oct 22, 2026
11 checks passed
@bryan-minimal
bryan-minimal deleted the add-google-java-format branch October 22, 2026 23:11
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.

2 participants

0