-
Notifications
You must be signed in to change notification settings - Fork 207
Run checkstyle as separate CI job on Linux with latest Java #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Move checkstyle out of the test phase and into a dedicated CI job. This allows dependabot to update the checkstyle version and speeds up test runs on Windows/macOS by not running checkstyle there. Checkstyle 13+ requires Java 21+, so we run it on Java 24 on Linux. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary of ChangesHello @horgh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request streamlines the Checkstyle integration within the project's build system. By decoupling Checkstyle from the standard test phase and moving it to a dedicated CI job, the change facilitates easier version management through Dependabot and enhances build efficiency by selectively running Checkstyle only on Linux with the necessary Java version. This ensures code quality checks are performed effectively without impeding other platform-specific test executions. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the Checkstyle configuration by moving it from a profile-based execution during the test phase to a standalone plugin definition. This change is intended to facilitate running Checkstyle in a dedicated CI job, especially since it now requires Java 21+, and to speed up local builds on other platforms. The changes in pom.xml correctly implement this by removing the checkstyle-jdk21 profile and adding the maven-checkstyle-plugin to the main build plugins without an execution binding. My review includes a suggestion to improve maintainability by managing the plugin and dependency versions through properties, which is a common best practice in Maven projects.
| <version>3.6.0</version> | ||
| <configuration> | ||
| <consoleOutput>true</consoleOutput> | ||
| <configLocation>checkstyle.xml</configLocation> | ||
| <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation> | ||
| <violationSeverity>warning</violationSeverity> | ||
| </configuration> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.puppycrawl.tools</groupId> | ||
| <artifactId>checkstyle</artifactId> | ||
| <version>13.0.0</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better maintainability, it's a good practice to manage plugin and dependency versions in the <properties> section. This centralizes version numbers, making them easier to update and keep consistent.
You could define properties in the <properties> section like so:
<properties>
...
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
<checkstyle.version>13.0.0</checkstyle.version>
</properties>And then reference them here. This makes future updates much simpler.
| <version>3.6.0</version> | |
| <configuration> | |
| <consoleOutput>true</consoleOutput> | |
| <configLocation>checkstyle.xml</configLocation> | |
| <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation> | |
| <violationSeverity>warning</violationSeverity> | |
| </configuration> | |
| <dependencies> | |
| <dependency> | |
| <groupId>com.puppycrawl.tools</groupId> | |
| <artifactId>checkstyle</artifactId> | |
| <version>13.0.0</version> | |
| <version>${maven-checkstyle-plugin.version}</version> | |
| <configuration> | |
| <consoleOutput>true</consoleOutput> | |
| <configLocation>checkstyle.xml</configLocation> | |
| <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation> | |
| <violationSeverity>warning</violationSeverity> | |
| </configuration> | |
| <dependencies> | |
| <dependency> | |
| <groupId>com.puppycrawl.tools</groupId> | |
| <artifactId>checkstyle</artifactId> | |
| <version>${checkstyle.version}</version> |
Move checkstyle out of the test phase and into a dedicated CI job. This allows dependabot to update the checkstyle version and speeds up test runs on Windows/macOS by not running checkstyle there.
Checkstyle 13+ requires Java 21+, so we run it on Java 24 on Linux.