prettier-java
Prettier Java Plugin (by jhipster)
google-java-format
Reformats Java source code to comply with Google Java Style. (by google)
prettier-java | google-java-format | |
---|---|---|
7 | 24 | |
1,106 | 5,658 | |
1.2% | 0.7% | |
8.1 | 8.6 | |
22 days ago | 11 days ago | |
Java | Java | |
Apache License 2.0 | GNU General Public License v3.0 or later |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
prettier-java
Posts with mentions or reviews of prettier-java.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-02-07.
-
How to beautify java code reliably
I ended up, from a friend suggestion, looking into a java prettier plugin. Prettier allowed for an easy integration with most Web IDE, can be configured to format on save for vscode and is trivial to run in CI.
-
Prettier extension doesn't work with java
Prettier does not natively support Java, they have a community plugin for Java https://github.com/jhipster/prettier-java (link is from prettier.io) are you using this? I don't use prettier with Java though, Im not sure it works with the VS Code extension out of the box. prettier by itself is a separate thing from the VS Code extension
-
Let's do a war
I didn’t realize prettier was used for other languages. I’ve been kinda frustrated with our java formatter at work, so I took a look at the prettier java formatter: https://github.com/jhipster/prettier-java
-
Zero Config Code Formatter?
Prettier has support for Java. https://github.com/jhipster/prettier-java
- Wednesday Links - Edition 2021-09-22
-
JHipster 7: What’s under the hood?
Did you know Prettier for Java is a JHipster project?
- Which code style plugin do you use in daily work?
google-java-format
Posts with mentions or reviews of google-java-format.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-11-14.
- Como Melhorar seu Código Java: 7 Boas Práticas e Padrões de Desenvolvimento
-
Contribution Instructions: Formate Code and Linting
We had a list of suggested code formation tools, as my code was written in Java I decided to use suggested formatter GoogleJavaFormat. However, I didn't decide to pick suggested tool for Linter. I picked Checkstyle; for the reason, that SpotBugs wasn't available for JDK 22.
-
Tutorial: Build a Java SDK based on OpenAPI Spec
google-java-format: A tool that reformats your code according to Google’s Java style, ensuring a clean, consistent codebase.
-
How to automatically format Java code similar to Rust (rustfmt)?
The code block you pasted is not at all what the Google Java Format utility would do. Don't use VSCode to handle IntelliJ's job :P
-
After a few attempts I'm officially a programmer :^)
Follow a style guide, doesn’t really matter which you choose, you’ll thank me later. This one will work automatically https://github.com/google/google-java-format
-
For Contributors to my OpenSSG
Like Prettier and ESLint in Javascript, I needed to add Java formatting and linting tools. For formatting, I looked at google-java-format, codestyle, and spotless. Since I'm not using Java framework, I can only use plugin to format my code. Although google-java-format does not support configurability, I just chose to follow Google Java format as I believe they have most common language format standard. To use google-java-format in MacOS, go to IntelliJ IDEA -> Preference (Windows: File -> Setting) and search "plugin" menu. Then, find google-java-format using search bar. Now all you need to do is to install the plugin. I didn't have to enable it, I think it needs to be enabled in some cases. You can refer to the documentation. To format your code, go to Code menu and select Reformat code or Reformat file. It will format your code.
-
Coding standards
I cloned a Maven plug-in that enforces Google code style guidelines (modifying a few things, like nesting depth): https://github.com/google/google-java-format
-
I declare as "final" every single variable whose value doesn't change. I also use "this" every time that I'm referring to an attribute, even when there's no ambiguity in not using it
They follow a rectangle rule, which is easy to follow, but can lead to ugly formatting due to excessive indentation in nested statements (which are common using protobuffers). The dart formatter was a lot nicer, and considered human friendly style instead of blindly following the rectangle rule.
-
Creating custom formatter for Java
I spent most of my development career writing simple CRUD applications, recently I read a fascinating article: http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/. It looks like a nice challenge to try creating such a tool. For sure I need first to understand how to build AST etc. I could reuse existing solutions like https://github.com/google/google-java-format, or eclipse fmt, but I would like to understand the whole process, to be able to debug all cases.
- I am about to start a war
What are some alternatives?
When comparing prettier-java and google-java-format you can also consider the following projects:
spotless - Keep your code spotless
palantir-java-format - A modern, lambda-friendly, 120 character Java formatter.
pretty-quick - ⚡ Get Pretty Quick
spring-javaformat
amber-docs - https://openjdk.org/projects/amber
formatter-maven-plugin - Formatter Maven Plugin
fmt-maven-plugin - Opinionated Maven Plugin that formats your Java code.
black - The uncompromising Python code formatter
prettier-java vs spotless
google-java-format vs spotless
prettier-java vs palantir-java-format
google-java-format vs palantir-java-format
prettier-java vs pretty-quick
google-java-format vs spring-javaformat
prettier-java vs amber-docs
google-java-format vs formatter-maven-plugin
prettier-java vs fmt-maven-plugin
google-java-format vs black
prettier-java vs spring-javaformat
google-java-format vs fmt-maven-plugin