-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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 Workflow for Java files #13413
Comments
One things you may need to care about: GitHub will not grant write access for workflows triggered in Pull Requests. |
@AlbumenJ Can the maintainers enable that option from the settings page of this GitHub repo? Then, I can get |
This is disabled by GitHub and we cannot change it :) |
@AlbumenJ It is not disabled by GitHub. It can be enabled. I have a repo which has this Workflow permissions enabled like this 👇 |
I think we can ask Apache for help. One thing I need to make it clear that is if someone want to submit some harmful actions and such actions will be enabled by default which have the write permission. A possible way to trigger by comment which is submit by members and run by comment trigger. |
@AlbumenJ Yeah, comments in pull request can be used to trigger the GH Action. If that looks good to you, I can work on this 😁. |
Great! You can have a try and be aware that security is important. It is unacceptable for someone to change others' code without members approval. |
Thank you @AlbumenJ! |
@AlbumenJ Please assign me this issue. I'll start working soon. |
@AlbumenJ I think that comments in PR is not an effective solution. We can have something like this 👇 |
Hi @SaptarshiSarkar12 , I think change contributors' PR directly is not a good way. |
@Koooooo-7 Yeah, that can be done. @AlbumenJ What do you think? |
However, can we make a repo only pre-commit hook automatically? |
Technically, yes. When contributors clone the project, the A feasible way is using the mvn lifecycle plugin (such as What the prerequisite we need is there must have Java env when the Besides the assumptions above. |
@AlbumenJ Koy (@Koooooo-7 ) said the correct methods to implement the one you are thinking. |
@Koooooo-7 Do you mean that users should exec
@SaptarshiSarkar12 Indeed. It's a good idea to post comments to remind contributors. |
Hi @AlbumenJ , user only need run Hi @SaptarshiSarkar12 , Although I raised this solution , it still looks little bit cumbersome to me tho.
If dubbo move to gradle soon, I suppose we could do the whole things by gradle at that time, instead of maintaining a weird |
These suggestions all make sense to me.
Got it. And this is a little
Moving to gradle is a good idea. However, it is hard for us to |
Yea, because we wanna contributors don't become aware of it and hooks can also work automatically.
I see, maybe I have token the wrong memo that I had seen something about dubbo and gradle thing in the early of this year. It sounds migrating to gradle hasn't put on the table yet. And it exactly a long terms thing, especially, the sort of compatibilities issues and avoid it impact too much for users. BTW, personally, I think if some breaking change is inevitable, just let it be. if worthy. :) |
@Koooooo-7 @AlbumenJ Thank you for the valuable suggestions.
|
Describe the feature
This project has a code style available in the
codestyle
directory. Checking whether the code in the Pull Requests follows the project's code style and applying fixes accordingly is a tedious work. I want to automate this check and it will also fix any code that violates the code style. The changes will be pushed to the source branch of the PR automatically. This check can also be applied for any branch of this repository.I would like to work on this issue.
The text was updated successfully, but these errors were encountered: