reactor / reactor-netty

TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
https://projectreactor.io
Apache License 2.0
2.54k stars 633 forks source link

CI: Add GitHub Actions to Auto-Format Java Files according to Checkstyle configuration #2984

Closed SaptarshiSarkar12 closed 7 months ago

SaptarshiSarkar12 commented 7 months ago

Motivation

This project has a code style defined in checkstyle.xml file in the codequality directory. Checking whether the code in the Pull Requests or branches follows the project's code style and applying fixes accordingly is a tedious work.

Desired solution

I want to use OpenRewrite's Gradle Plugin to automatically format the Java files using the Checkstyle configuration. I would also like to create a GitHub Actions to automatically run the formatter and push the changes to the branches or the PRs.

Additional context

I have implemented this feature in an Open-Source project - Drifty and the GitHub Action also pushes the formatted files to the branches or PRs as you can see below :point_down: Screenshot from 2023-11-25 08-22-24 If this issue seems good to the maintainers and adds some value to the project, then, I would like to work on this issue.

violetagg commented 7 months ago

@SaptarshiSarkar12 Thanks for getting in touch. The idea of having checkstyle is to help contributors prepare a PR that complies with the formatting rules of the project (and not only formatting rules I would say) and in general learn the project's code. In addition, having the correct formatting in place, when reviewing PRs, is in great help for the maintainers. I do not think that having a CI that does the formatting afterwards is the ways we would like to go.

SaptarshiSarkar12 commented 7 months ago

@violetagg Okay. Got it. Thank you :grin:!