Skip to content

Commit 5807c59

Browse files
committed
ci: Run the pre-commit formatter on the project's JDK
The pre-commit workflow set up Python but no Java, so google-java-format ran on the runner's default JDK 17 and could not parse this project's Java 25 sources — every file using an unnamed `_` binding or a record pattern failed to parse. Those constructs predate this branch; the job only fails when a pull request happens to touch such a file. Adds the same setup-java step pull_request.yaml already uses, keyed off .java-version, and bumps extenda/pre-commit-hooks to v0.16.1. Verified locally across the matrix: on JDK 17 the formatter fails with either jar version (1.28.0 cannot parse `_`, 1.36.1 throws LinkageError); on JDK 25 both pass. The JDK is the fix, the bump is housekeeping.
1 parent 0ac5e48 commit 5807c59

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
- name: Setup Python
1313
uses: actions/setup-python@v7
1414

15+
- name: Setup Java
16+
uses: actions/setup-java@v6
17+
with:
18+
distribution: temurin
19+
java-version-file: .java-version
20+
1521
- name: Run pre-commit
1622
uses: pre-commit/actions@v3.0.1
1723
with:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
hooks:
1818
- id: editorconfig-checker
1919
- repo: https://github.com/extenda/pre-commit-hooks
20-
rev: v0.15.0
20+
rev: v0.16.1
2121
hooks:
2222
- id: google-java-formatter
2323
- id: commitlint

0 commit comments

Comments
 (0)