Skip to content

feat: consolidate Checkstyle and Codenarc errors into single file for GitHub workflow#15486

Open
mika-collins wants to merge 3 commits intoapache:7.0.xfrom
mika-collins:feat/issue-15088-consolidate-codestyle-reports
Open

feat: consolidate Checkstyle and Codenarc errors into single file for GitHub workflow#15486
mika-collins wants to merge 3 commits intoapache:7.0.xfrom
mika-collins:feat/issue-15088-consolidate-codestyle-reports

Conversation

@mika-collins
Copy link
Contributor

@mika-collins mika-collins commented Mar 8, 2026

Description

This PR addresses issue #15088.

The goal is to consolidate Checkstyle and Codenarc error reports into a single known location and publish them directly to the GitHub Actions job summary, making it easier to identify failures without searching through multiple zip artifacts.

Changes

GrailsCodeStyleExtension.groovy

  • Added reportsDirectory property that defaults to rootProject.buildDir/reports/codestyle, providing a single location for all code style reports across subprojects.

GrailsCodeStylePlugin.groovy

  • Configured Checkstyle tasks to redirect XML report output to reportsDirectory/checkstyle/<projectname>.xml.
  • Configured Codenarc tasks to enable XML report output and redirect to reportsDirectory/codenarc/<projectname>.xml.
  • Each project writes to a file named after the project to avoid overwriting.

.github/workflows/codestyle.yml

  • Updated artifact upload paths to point to the new reports directory.
  • Changed upload condition from failure() to always() so reports are available regardless of build outcome, aligning with the existing pattern in rat.yml.
  • Added "Publish Code Style Report Summary" step to each job, parsing Checkstyle and Codenarc XML reports and writing errors directly to the GitHub Actions job summary, similar to how RAT errors are already handled.

Testing

  • Verified single report output locally by introducing intentional Checkstyle and Codenarc errors and confirming reports are written to build/reports/codestyle.
  • Verified via GitHub Actions on this PR. All three jobs (Core Projects, Gradle Plugin Projects, Forge Projects) passed successfully and the "Publish Code Style Report in Job Summary" step executed without errors.

@borinquenkid
Copy link
Member

Are you able to apply Spotless automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants