You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0c83b88
Browse filesBrowse the repository at this point in the historyBrowse files
Check with open-java-format 2.98.0.2, and on Windows too
open-java-format 2.98.0.2 has a single style, so the action and the pre-commit hook stop passing --ojf, which that version only warns about, and both default to 2.98.0.2. A workflow that still pins 2.98.0.1 would now check in Google style, so this goes out as v2, and such a workflow stays on v1.
2.98.0.2 also ships a native binary for Windows on x86-64. The action and the hook recognise a Windows runner or Git Bash by uname, download the binary with its .exe extension, and keep that extension on disk.
The CI used to run the action on a repository without Java files, so it checked nothing. It now writes a formatted file and one that is not, and expects the action to pass the first and fail the second, on Linux and macOS on both architectures and on Windows; the hook runs through the same two cases in a scratch repository.
Copy file name to clipboardExpand all lines: README.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,18 @@ No Java, Maven, or Gradle required — downloads a native binary from Maven Cent
9
9
```yaml
10
10
- uses: actions/checkout@v7
11
11
12
-
- uses: openjavaformat/open-java-format-action@v1
12
+
- uses: openjavaformat/open-java-format-action@v2
13
13
with:
14
-
version: '2.98.0.1'
14
+
version: '2.98.0.2'
15
15
```
16
16
17
+
v2 is for open-java-format 2.98.0.2 and later, which has a single style. A workflow that pins 2.98.0.1 stays on `@v1`, which passes that version the `--ojf` flag it needs.
18
+
17
19
## Inputs
18
20
19
21
| Input | Required | Default | Description |
20
22
|-------|----------|---------|-------------|
21
-
| `version` | yes | `2.98.0.1` | Version of the open-java-format native binary, one of those on [Maven Central](https://repo1.maven.org/maven2/dev/openjavaformat/open-java-format-native/) |
23
+
| `version` | yes | `2.98.0.2` | Version of the open-java-format native binary, one of those on [Maven Central](https://repo1.maven.org/maven2/dev/openjavaformat/open-java-format-native/) |
22
24
| `mode` | no | `changed` | `changed` — only files from PR or push; `all` — every `.java` file in repo |
23
25
24
26
## How `mode: changed` works
@@ -32,12 +34,12 @@ No Java, Maven, or Gradle required — downloads a native binary from Maven Cent
32
34
- If all files are formatted correctly → passes ✅
33
35
- If any file has formatting issues → lists unformatted files and fails ❌
34
36
35
-
Files are checked in the open-java-format style, `--ojf` (formerly `--palantir`). When the check fails, fix locally with a native binary or the runnable jar from the [open-java-format releases](https://github.com/openjavaformat/open-java-format/releases):
37
+
Files are checked in the open-java-format style, the formatter's only style. When the check fails, fix locally with a native binary or the runnable jar from the [open-java-format releases](https://github.com/openjavaformat/open-java-format/releases):
echo "::error::No open-java-format native binary for ${OS}-${ARCH}. Supported: Linux x86_64, Linux aarch64, macOS aarch64, macOS x86_64."
36
+
echo "::error::No open-java-format native binary for ${OS}-${ARCH}. Supported: Linux x86_64, Linux aarch64, macOS aarch64, macOS x86_64, Windows x86_64."
36
37
exit 1
37
38
;;
38
39
esac
39
40
41
+
# The Windows binary is an .exe, on Maven Central and on disk. It exists from 2.98.0.2 on.
0 commit comments