Skip to content

Conversation

@gavinking
Copy link
Member

@gavinking gavinking commented Sep 27, 2024

Competes with #9011.

This completely removes checkstyle, and enforces IllegalImport, RightCurly (UPDATE: and now UpperEll) via a simple line-based regex scan.

  • It takes less than a second to run, compared to four minutes for checkstyle on my machine.
  • It actually reports violations in the console where they belong, instead of producing a completely useless multipage HTML report I have to hunt through.

If @sebersole cares about EqualsHashCode or UpperEll, I believe I can implement them too, using the exact same technology. Of course, EqualsHashCode probably can't be done quite perfectly using a regex, but it can certainly can be done in a way that's more than "good enough". (UpperEll can be implemented perfectly, since regexes are capable of tokenization.)

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Sep 27, 2024

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [1e43182, 461e868]

› This message was automatically generated.

@gavinking
Copy link
Member Author

UpperEll can be implemented perfectly, since regexes are capable of tokenization.

OK, screw it, I added a shit (but probably "good enough") implementation of UpperEll just because it was trivial. It doesn't handle comments correctly, but I doubt we care, and it would be very easy to add if we do.

This is ~ 2 orders of magnitude faster on my machine, so it can be
executed as part of the compileJava task. Also, it actually logs the
failures, instead of making me go hunt for them in some generated
HTML-based report.
@sebersole
Copy link
Member

EqualsHashCode is nice to have, but you got all the others so I guess I don't care that much.

@gavinking
Copy link
Member Author

OK, then lemme see if I can implement a "good enough" EqualsHashcode without it slowing things down too much. I guess I probably can.

@gavinking
Copy link
Member Author

OK, then lemme see if I can implement a "good enough" EqualsHashcode

Pushed.

@sebersole sebersole merged commit 40591ad into hibernate:main Sep 30, 2024
23 of 24 checks passed
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