-
Notifications
You must be signed in to change notification settings - Fork 54
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
configure and run OpenRewrite #805
Conversation
This configures OpenRewrite so it can be run on our repository. There is no change to the normal build, the maven goal must be invoked explicitly (for instance via the new launch configuration).
With modern version control system providing more details, the author tag is an anti-pattern, especially when we want to have team ownership of the code. All changes were created automatically.
Checkstyle is not enforced over plugin due a lot of violations. |
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.
Let's try this auto fixer.
No. While this change fixes some of them, there are still thousands of violations. As I mentioned already in #388 and other issues, it would be simple to fix 90% of those several thousands violations in an automated way, e.g. using OpenRewrite, the Eclipse clean actions and the Eclipse formatter. I already did that locally in 2022 within 4 hours of work. However, these fixes for the 90% of violations would lead to the patch filter raising many of the remaining 10% of issues because they happen to be in the same lines. And I don't want to do any manual changes for these 10% just to pass the diff filter. I just want to commit the automated changes for the 90% of issues ignoring the diff filter, because it fixes some thousand violations, and requiring zero remaining violations in 20.000 changed lines is just not useful.
I've been using it on more than a million lines of production code already over the last 2 years. While it does have some bugs in corner cases, it still makes cleaning up old code bases much more efficient. Some projects like the Spring project meanwhile have all their upgrade guides as OpenRewrite refactorings, such that all Spring users can upgrade automatically. |
@Bananeweizen , please keep @Calixte in loop of all changes before merge. |
OpenRewrite is a mass refactoring engine to which I contribute since 2 years. This PR configures it and runs several refactorings. Every refactoring kind is in a separate commit for easier review. I intend to enable more of the recipes later and to submit more such changes until we reach a state where all enabled recipes can be run periodically and all changes can be submitted in one go.
@rnveach The main checkstyle project might profit from a similar configuration even more. Here in this project a lot of the recipes don't catch all occurrences, because the classes loaded by Tycho are not available to the type system inside OpenRewrite. In the main project everything is plain maven, therefore each recipe should apply everywhere. If you want me to configure something (like the "RemoveTestPrefix" recipe or similar) for a demo PR, then mention me, please.