-
Notifications
You must be signed in to change notification settings - Fork 998
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
Auto format to Google style with Spotless #317
Conversation
Hi @ches. Thanks for your PR. I'm waiting for a gojek member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
Good points @ches Another one to note is that we are using https://pypi.org/project/black/ for formatting Python code. I'm quite in favor of having these tools take over completely, especially during submission of PRs. I also think adding it for the license headers makes sense. |
@ches if you can refresh this then I will approve it. Sorry for the delay. |
No worries. Rebased and added the license header support for Java files. Removing blank lines between existing headers and |
/retest |
/lgtm |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ches, woop The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest We really need to fix these tests :( |
We state in the contributing guide that we conform to Google Java style, but actually we don't. This applies the Spotless Maven plugin which runs the Google formatter automatically.
The plugin can also take care of license headers, I didn't enable that yet but I can if you'd like.
This is obviously opinionated, I went ahead and sent this PR to open discussion because actually writing the change took 5 minutes, I won't be hurt if we don't use it. Also I thought that just after cutting 0.3 may be as opportune a time as it gets, hopefully not too many branches/PRs in flight that will suffer merge conflicts from a mass formatting application.
Having coding standards checks run automatically in the build adds a bit of friction for contributing. Automation though is arguably favorable to human reviewers remarking subjectively about such matters, for both parties. Measures can be taken to make the CI experience as pleasant as possible, suggesting how to fix infractions and resubmit.
Personally, I don't write Java everyday, so I don't have a tuned sense of what a lot of constructs should idiomatically "look like" and I appreciate it being answered for me, but I warmed to auto-formatting years ago so I'm biased.
As one point of precedent, the Beam project uses Spotless in their build. Of course in the Kubernetes ecosystem like Kubeflow,
go fmt
is ubiquitous and we mention it for the Feast Go SDK.