Skip to content

Choose a tag to compare

@abashev abashev released this 15 Sep 19:10
· 15 commits to main since this release
Immutable release. Only release title and notes can be modified.
c92d916

First release of the GitHub Action for open-java-format.

Checks the formatting of Java files with the open-java-format native binary, downloaded from Maven Central — no Java, Maven or Gradle needed on the runner. The same check also comes as a git pre-commit hook.

- uses: actions/checkout@v7

- uses: openjavaformat/open-java-format-action@v1
  with:
    version: '2.98.0.1'
    mode: ${{ github.event_name == 'push' && 'all' || 'changed' }}

What's in it

  • mode: changed checks only the files of the pull request or push, mode: all checks every .java file
  • Files are checked in the open-java-format style (--ojf); fix them locally with open-java-format --ojf --replace <files>
  • Files matching .open-java-format-exclude in the repository root are skipped, by the action and the hook alike
  • A warning when a newer open-java-format release is out
  • Native binaries for Linux x86_64 and aarch64 (glibc), macOS Apple Silicon and Intel