-
Notifications
You must be signed in to change notification settings - Fork 218
Setup code formatter #248
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
Setup code formatter #248
Conversation
Not a big fan of the Google format but what matters most is consistency so I'm fine with it if people like it. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If we are all fine with it, I'll add a check to the pr.yml to ensure that the code is formatted before being merged into the master branch |
Even better would be to be able to format the code on build or as a pre-commit hook. |
I've never had a good experience in using pre-commits, they usually make the commits way slow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Conflicts: # operator-framework/src/main/java/io/javaoperatorsdk/operator/ClassMappingProvider.java # operator-framework/src/main/java/io/javaoperatorsdk/operator/ControllerUtils.java # operator-framework/src/main/java/io/javaoperatorsdk/operator/processing/annotation/AccumulativeMappingWriter.java # operator-framework/src/main/java/io/javaoperatorsdk/operator/processing/annotation/ControllerAnnotationProcessor.java # operator-framework/src/test/java/io/javaoperatorsdk/operator/ControllerUtilsTest.java
Would be good to merge this PR if there is no objection. |
@psycho-ir how do we set up our IDEs to use the format automatically? |
If you use intelliJ there is a plugin: |
The google-java-format plugin does not optimize imports with respect to the google format style. |
yep that sounds good! |
On retrospect, allowing this PR to go through at this point was a huge mistake… I'm in a world of pain to rebase my quite consequent PRs and I fear it's going to take days just to fix everything… 😭 |
revert the commits from this PR? |
I think we already merged things after that. We should be more careful next time with these changes :( |
@metacosm it would not help if you would format your code with the new formatter too on the branch? |
@csviri that's what I did and I managed to get one branch updated. I need to update the fabric8 client 5.0 branch now… Depending on how it goes, I might just re-apply the changes on top of a new branch 😄 |
I setup the default google formatter.
Let me know how you like this format.
@metacosm @adam-sandor @csviri @kirek007