Skip to content
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

Adds checkstyles to project #48

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

onobc
Copy link
Collaborator

@onobc onobc commented Nov 7, 2024

This commit configures in the Puppycrawl checkstyle with the Spring JavaFormat.

To avoid the intrusive nature of such a change, the spring-grpc-core module is the only one to have the checkstyles applied. I will handle the other modules as time permits.

This commit configures in the Puppycrawl checkstyle with the Spring JavaFormat.

To avoid the intrusive nature of such a change, the spring-grpc-core module is
the only one to have the checkstyles applied. I will handle the other modules as
time permits.

Signed-off-by: Chris Bono <[email protected]>
@onobc onobc requested a review from dsyer November 7, 2024 05:14
@@ -10,6 +10,13 @@ Before submitting a PR, please run the following commands to ensure proper forma

The `-Pjavadoc` is a profile that enables Javadoc processing so as to avoid a long build time when developing.

<dl><dt><strong>📌 NOTE</strong></dt><dd>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is this auto-generated from contribution-guidelines.adoc?

<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value/>
</option>
<option name="IMPORT_LAYOUT_TABLE">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These import order are in line w/ the ones in the checkstyle which allows us to easily optmize imports from w/in IDEA and have them match the checkstyles.

I am sure there is something similar for other editors. I created a wiki page that tells how to do this for IDEA. W/ a TODO section for other editors.

@@ -438,6 +488,20 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These were required as the checkstyle enforce AssertJ over Junit assertEquals

<property name="format" value="\.toLowerCase\(\)"/>
<property name="maximum" value="0"/>
<property name="message"
value="String.toLowerCase() should be String.toLowerCase(Locale.ROOT)"/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here is a bonus for the prevention of the toLower|upperCase w/ no locale CVE.

@dsyer dsyer merged commit daf8e04 into spring-projects-experimental:main Nov 7, 2024
1 check passed
@dsyer
Copy link
Collaborator

dsyer commented Nov 7, 2024

Sigh. I hate these rules. I guess it’s inevitable they will get in here eventually though.

@onobc
Copy link
Collaborator Author

onobc commented Nov 7, 2024

Sigh. I hate these rules. I guess it’s inevitable they will get in here eventually though.

I too have mixed feelings. I end up "accepting" consistency though. 🙁

Thanks for the review and merge.

@onobc onobc deleted the add-checkstyles branch November 7, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants