Closed SaptarshiSarkar12 closed 7 months ago
"Checkstyle" is already configured, and I suggest we do not increase its verifications as Checkstyle produces hard to understand failure messages.
Do you think you could try integrating Openrewrite? See https://github.com/pgjdbc/pgjdbc/pull/2979
We use Autostyle for some of the automatic fixes: https://github.com/autostyle/autostyle
@vlsi Yes, I just learned how to integrate Openrewrite in my Open-Source Java project - Drifty and it is very good at its work. You can see that the last commit to that repo is about the Java files being formatted.
I will do two things -
So, can I work on this issue?
I'm -0.5 for pushing formats from GitHub Actions. I am afraid it would violate the Apache Software Foundation rules. I would rather start with making PRs fail if there are unformatted changes. WDYT?
@vlsi I am not sure if it would violate Apache Software Foundation Rules. But, automating the formatting of files is just saving time a bit - which I think helps developers to concentrate more on the logic and also helps in faster review. It also gives a great experience for other contributors - they don't have to check for failure in code style themselves (let's think if there are huge changes made and multiple checkstyle violations have occurred).
I am not sure if it would violate Apache Software Foundation Rules.
@SaptarshiSarkar12 , please show us the relevant issue at https://issues.apache.org/jira/browse/LEGAL or https://lists.apache.org/list.html?legal-discuss@apache.org that concludes that "robots are fine to commit formatting changes to the main branches". Otherwise, I am not going to discuss and merge such an Action.
@vlsi Sorry, I couldn't find any relevant issue. Might be because it is a rule. I am closing this issue then.
@vlsi I have one question. Does Apache v2 license explicitly specify any such rules?
Apache 2 license does not forbid that. However, there are certain rules within the Apache Software Foundation.
You might raise an issue at LEGAL or start a discussion to get clarification. However, I doubt they would allow such bots.
@vlsi Okay. I understood. No, its fine - Apache can make rules. No problem in that. I just wanted to know if apache license mentions any kind of this statement as it is used by my project :sweat_smile:.
Use case
This project has a code style available in the
config/checkstyle
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.Possible solution
A GitHub Action can be set up to check for checkstyle violations and automatically format those files according to the checkstyle configuration. The changes will be automatically pushed to the branch and PR's source branch. I would like to work on this issue.
Possible workarounds
No response
JMeter Version
5.6.1
Java Version
java 20.0.2 2023-07-18
OS Version
Ubuntu 23.10