-
Notifications
You must be signed in to change notification settings - Fork 283
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
CI: Add Auto-Format GitHub Actions to automatically format Java Files #2429
Comments
@havetisyan Does this issue seem good to you? If yes, then, I am willing to work on this. |
@SaptarshiSarkar12 I'm not sure what value this provides? Why would we allow files to be checked in in the first place that do not conform to our check style guidelines? This might be useful for some project that didn't have check style configured from day one and now they want to impose it, but I'm not sure what value it provides for our project. |
@havetisyan The OpenRewrite Maven plugin modifies the java files in such a way that they do not violate the checkstyle configuration. So, the automated code style of the project removes the burden of checking whether the modified files in Pull Requests, conform with the checkstyle configuration. |
I'm just a lurker.
I suggest that you please provide the style settings for IDEs such that
developers push code compliant with the correct style, rather than amend
code that the developer has pushed.
…-- Sriram
On Tue, Nov 28, 2023 at 11:08 AM Saptarshi Sarkar ***@***.***> wrote:
@havetisyan <https://github.com/havetisyan> The *OpenRewrite Maven plugin*
modifies the java files in such a way that they do not violate the
checkstyle configuration. So, the automated code style of the project
removes the burden of checking whether the modified files in Pull Requests,
conform with the checkstyle configuration.
Does that make sense?
—
Reply to this email directly, view it on GitHub
<#2429 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF5JGXIREORHKSOFQLRZGTYGVITRAVCNFSM6AAAAAA7Z2GJVSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYHE4TOOBVGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@sriramnrn We can set up git hooks to trigger the |
Right now in our setup check style plugin runs before we even compile the code. So you cannot compile any code if it does not conform to the requirements. You need to fix your code before you can compile and run test, etc. There is no need for git hooks or additional plugins. |
@havetisyan Okay, I see. But, can the OpenRewrite plugin run before checkstyle plugin to format the files so that most (if not all) of the checkstyle violations get resolved? |
Is your feature request related to a problem? Please describe.
This project has a code style defined in the
athenz-checkstyle.xml
file. Checking whether the code in the Pull Requests or branches follows the project's code style and applying fixes accordingly is a tedious work.Describe the solution you'd like
I want to use
OpenRewrite's Maven 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 👇
If this issue seems good to the maintainers and can add some value to the project, then, I would like to work on this issue.
The text was updated successfully, but these errors were encountered: