-
Notifications
You must be signed in to change notification settings - Fork 49
Run checkstyle as separate CI job on Linux with latest Java #338
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
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 project's Checkstyle integration by isolating it into a dedicated CI job. This separation allows for more efficient management of Checkstyle updates through Dependabot and optimizes build times by preventing Checkstyle from running on non-Linux environments. The configuration now explicitly targets Java 24 on Linux to meet the requirements of Checkstyle 13+. 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
|
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]>
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 correctly refactors the Maven configuration to run Checkstyle in a dedicated CI job. By moving the maven-checkstyle-plugin out of a profile and removing its binding to the test phase, the build process is made more flexible and efficient, accommodating the JDK requirement for the newer Checkstyle version. The changes are clear and achieve the intended goal. I have one suggestion to further improve the maintainability of the pom.xml.
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-checkstyle-plugin</artifactId> | ||
| <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> | ||
| </dependency> | ||
| </dependencies> | ||
| </plugin> |
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 improved maintainability, consider managing plugin and dependency versions using properties. Centralizing versions in the <properties> section makes them easier to manage and update across the project. This is a common Maven best practice.
For example, you could add these to your <properties> block:
<properties>
...
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
<checkstyle.version>13.0.0</checkstyle.version>
</properties>Then you can reference them in this plugin definition using ${...}. This approach simplifies version updates and improves consistency, especially when used with the versions-maven-plugin which is already part of this project.
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.