-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Use Prettier Java for automatic code formatting #10646
Conversation
No, please keep spaces! Even though they might be better suited for some people this will mess up everything else |
+1 for keeping spaces. Modern braille displays should be able to deal with multiple whitespaces. If we change this, almost every line of code will be changed and the whole git history and blame will only show one name. Even though you can go back in history with some commands, it won't be shown directly and will destroy the very overlook on the blame. |
It seems to still break at 80 chars width or at least introduces a lot of unnecessarily wrapping |
That can be easily fixed with .git-blame-ignore-revs (which should be used anyway for large reformatting changes such as this PR) |
OMG. - Because they rely on prettier, this is configurable. I switched from palantir, which has 120 characters, but a "review-friendly" wrapping - https://github.com/palantir/palantir-java-format#motivation--examples. I changed to 100 chars. But that is no "review-friendly" line wrapping. Code less readable IMHO. Thus, I am closing this one and go back to try out palantir. |
Background
I am so fed up that
I checked multiple formats and tools (palantir-java-format (JabRef#663), spring-java-format, google-java-format, spotless, square java style) - and "Prettier Java" seems to be best
I focus in
*.java
. XML could come next.Changed
Notes
When coming from a fork, this action will just fail.
See https://github.com/orgs/community/discussions/75867 for details.
I had to disable the OpenRewrite rule UnnecessaryParentheses - see openrewrite/rewrite-static-analysis#219 for details
Next steps
Better comments
The commenting action cannot comment on pull requests, but @reviewdog can. I removed the commenting things here. Follow-up is to convert the output in case of errors to a format consumable to reviewdog.
Negleted by the team
I would like to switch from spaces to tabs:
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)