Skip to content

Conversation

@onobc
Copy link
Contributor

@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 <chris.bono@gmail.com>
@onobc onobc requested a review from dsyer November 7, 2024 05:14

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
Contributor 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
Contributor 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.

<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
Copy link
Contributor 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
Contributor 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:main Nov 7, 2024
1 check passed
@dsyer
Copy link
Member

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
Contributor 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