spring-io / spring-javaformat

Apache License 2.0
795 stars 110 forks source link

Broaden Checkstyle rule for AssertJ assertion enforcement #392

Closed izeye closed 11 months ago

izeye commented 11 months ago

This PR updates the Checkstyle rule for AssertJ assertion enforcement to include JUnit Jupiter and broaden the scope of org.junit.Assert by removing the ".assert" part.

sbrannen commented 11 months ago

Related to spring-projects/spring-framework#31116

wilkinsona commented 11 months ago

Thanks very much, @izeye.

I assumed that the intention here was to broaden the enforcement for projects using Spring Java Format. The change as you had made it affected Spring Java Format itself and not the Checkstyle rules that it applies to other projects. I've corrected that in https://github.com/spring-io/spring-javaformat/commit/29090605710af73fab15313147b0f0c5da00af1b. Note that I undid your original change as part of this as it caused a build failure due to the blunt regex-based approach matching some code that wasn't actually an import.

Please let me know if I've got this wrong.