-
Notifications
You must be signed in to change notification settings - Fork 29
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
[Java] Replace checkstyle with google-java-format or another formatter? #213
Comments
+1! Coming from the python world, where I think I spent at least 15 minutes the other day manually fixing little things to make checkstyle happy; I would love to only have to think about the code and not formatting. Another interesting option is https://github.com/jhipster/prettier-java. I see that |
Unfortunately, CI relies on archery (which will recheck every file), not pre-commit, so that's not quite an option prettier may be nice if we already use prettier elsewhere (I don't think we do), also not sure if it has integration with typical Java IDEs In any case any of {google-java-format, clang-format, prettier} would probably be better than checkstyle |
From a quick glance, I would probably feel most comfortable with google-java-format (all Java, maintained). prettier-java looks to have its own Java parser and I'm not sure how much clang-format's Java support is used (or if it'll keep up with Java syntax changes, not that we can use them for a while yet...) |
Thoughts on using filter branch to apply formatting without losing git blame? There are a fair amount of commits, and it'd take a while to get through all of them... |
We can't rewrite history. |
We can use that feature for ignoring commits for blame. |
Ah, completely forgot that filter branch rewrites history 🤦♂️ |
We already integrated Spotless. |
Describe the enhancement requested
checkstyle is unfortunately only a linter and cannot auto-format. google-java-format (or possibly some other plugin like clang-format) can be run to check and reformat files. google-java-format additionally integrates with IntelliJ. This makes development smoother.
However, we would have to reformat the entire codebase. Possibly, we can do this module-by-module.
Component(s)
Developer Tools, Java
The text was updated successfully, but these errors were encountered: