From 3ee3814de59624587db4eccc1053460bcf617315 Mon Sep 17 00:00:00 2001 From: "Claude (on behalf of Steven Schlansker)" Date: Fri, 26 Jun 2026 19:33:43 +0000 Subject: [PATCH] ci: annotate checkstyle violations in the Code Style Check job The Code Style Check job runs checkstyle:check via run_ci.py format. On a violation, the maven-checkstyle-plugin prints the actionable detail (file, line, rule, message) on [WARN] lines, then fails with a bare [ERROR] "N Checkstyle violations" line. GitHub's default log parser surfaces only the contentless [ERROR] line, so the job annotation reads "Error:" with no body and contributors cannot tell what failed. Add a problem matcher that parses the [WARN] lines (absolute path, line, column, message) into file-level annotations, and register it before the format step. Checkstyle is the check whose failure detail is otherwise dropped; spotless already prints a descriptive per-file [ERROR] line and is left as is. --- .github/maven-style-matcher.json | 17 +++++++++++++++++ .github/workflows/ci.yml | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 .github/maven-style-matcher.json diff --git a/.github/maven-style-matcher.json b/.github/maven-style-matcher.json new file mode 100644 index 0000000000..41735617dc --- /dev/null +++ b/.github/maven-style-matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "maven-checkstyle", + "severity": "error", + "pattern": [ + { + "regexp": "^\\[WARN\\]\\s+(\\S.*\\.java):(\\d+):(?:(\\d+):)?\\s+(.+)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + } + ] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c46905dc20..5c770366e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1882,6 +1882,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: 20.x + - name: Register Checkstyle problem matcher + run: echo "::add-matcher::.github/maven-style-matcher.json" - name: Check code style run: python ./ci/run_ci.py format