Skip to content

Conversation

@matrei
Copy link
Contributor

@matrei matrei commented Aug 26, 2025

This PR adds CodeNarc and Checkstyle Gradle Plugins to enforce code styles.
It adds a Gradle task codeStyle to run all codenarc* and checkstyle* tasks exclusively.

It also adds a Gradle property check for skipCodeStyle to skip code style checking when running build or check.
Existing GitHub workflows are updated to use this property and a new workflow is added that does only code style checks.

# Run all style checks locally
./gradlew codeStyle

# Include style checks during build/check
./gradlew check
./gradlew build

# Skip style checks (e.g., for quick iterations or CI main pipelines)
./gradlew check -PskipCodeStyle
./gradlew build -PskipCodeStyle

matrei added 3 commits August 26, 2025 14:08
Style/formatting checks are executed only by the new workflow,
keeping the main pipelines focused on build/test.
@matrei matrei force-pushed the enforce-code-style branch from 272eeac to ae2efa2 Compare August 26, 2025 12:38
@matrei matrei force-pushed the enforce-code-style branch from 945eca0 to 20468a4 Compare August 26, 2025 13:29
matrei added 4 commits August 26, 2025 15:38
Code style tools (Checkstyle/CodeNarc) generate reports even when clean.
Fail fast on style violations instead of continuing and producing
pages of reports. Developers can still use `--continue` locally when needed.
@jamesfredley jamesfredley moved this to In Progress in Apache Grails Aug 26, 2025
@jamesfredley jamesfredley added this to the grails:7.0.0-RC2 milestone Aug 26, 2025
@matrei matrei force-pushed the enforce-code-style branch from 3aff10e to ef17c7f Compare August 27, 2025 08:14
@matrei matrei requested a review from jamesfredley August 27, 2025 09:03
Copy link
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update DEVELOPMENT.md for the new properties & codestyle workflows?

matrei added 5 commits August 27, 2025 16:34
`-Dorg.gradle.internal.publish.checksums.insecure=true`
is no longer required as it is set by the publish
plugin by default.
Add info about useful custom Gradle tasks.
Update the section on code style.
@matrei matrei merged commit af5f2fd into apache:7.0.x Aug 29, 2025
36 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Apache Grails Aug 29, 2025
@matrei matrei deleted the enforce-code-style branch August 29, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants