Skip to content

ci: fast Java formatting check using google-java-format native binary#1227

Open
zeitlinger wants to merge 2 commits intomainfrom
native-lint-java
Open

ci: fast Java formatting check using google-java-format native binary#1227
zeitlinger wants to merge 2 commits intomainfrom
native-lint-java

Conversation

@zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Mar 20, 2026

Summary

  • Replaces Gradle-based spotlessCheck in the lint:spotless mise task with google-java-format native binary (lint:java)
  • Checks only changed files (vs origin/main), runs in ~42ms instead of minutes
  • Also checks license headers (SPDX-License-Identifier)
  • CI still runs the full spotlessCheck via Gradle as the authoritative check
  • Adds ubi:google/google-java-format as a mise tool (Renovate will keep it current)

Test plan

  • mise run lint:java passes with no changed Java files
  • mise run lint:java detects formatting issues and missing license headers
  • mise run fix auto-formats changed Java files
  • CI spotlessCheck still runs and passes

Copilot AI review requested due to automatic review settings March 20, 2026 16:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates local Java linting to be fast and scoped to changed files by using the google-java-format native binary (while keeping Gradle Spotless as the authoritative CI check).

Changes:

  • Add ubi:google/google-java-format as a pinned mise tool.
  • Replace the Gradle-based Spotless lint task with a lint:java task that checks only changed .java files and validates SPDX headers.
  • Update fix to format changed Java files via google-java-format before running the full lint suite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zeitlinger zeitlinger changed the title ci: use google-java-format native binary for local lint ci: fast Java formatting check using google-java-format native binary Mar 20, 2026
Replaces the slow Gradle-based spotlessCheck in the lint:java mise task
with google-java-format native binary (~42ms for changed files).
Also checks license headers. CI still runs the full spotlessCheck via Gradle.
Copilot AI review requested due to automatic review settings March 20, 2026 17:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zeitlinger zeitlinger marked this pull request as ready for review March 20, 2026 17:50
@zeitlinger zeitlinger requested a review from jaydeluca as a code owner March 20, 2026 17:50
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.

3 participants