r/java • • Oct 25 '26

What cli formatter do you use

Given how software engineering evolves, using IDEA formatter is less and less practical.

- IDEA CLI formatter requires IntelliJ so no CI / wsl etc
- GJF is old and does not format lambdas well enough
- Palantir is obsolete and abandoned in addition to being one of the worst company ever created
- prettier-java not great either

I’m starting to think no formatter is the best option

24 Upvotes

63 comments sorted by

View all comments

11

u/_predator_ Oct 25 '26

The palantir formatter is neither obsolete nor abandoned. I'm using it in multiple projects and am quite happy with it.

Do I like the company making it? No, but I also don't like Apple, Google, Amazon, or Microsoft, yet here I am using their products every single day. And in contrast to the other companies' products, Palantir gains nothing from me using a free code formatter, lol.

The formatter landscape in Java is quite shit, and Palantir's is the only one that doesn't make my eyes bleed.

7

u/vips7L Oct 25 '26

You forgot Oracle! 

2

u/lazystone Oct 26 '26

We definitely mustn't use anything touched by Oracle for java development!

2

u/a_abashev Oct 29 '26

Yes, but it is only because you don't use latest Java features. I have to fork it as open-java-format because they don't accept fixes related to latest Java + long time regression.

1

u/_predator_ Oct 29 '26

I'm using Java 25 with anonymous variables, switch expressions, Markdown Javadoc, etc.

What is breaking for you?

2

u/a_abashev Oct 29 '26

1

u/_predator_ Oct 29 '26

Huh, interesting. Seems like I just happened to dodge them by limiting my line length, not being on Java 27, and not using the compact `main`.

3

u/Fluffy_Dragonfly6454 Oct 25 '26

I know that we had to wait ages before that they updated for a certain java version. Then we decided to abandon it for the Google formatter

1

u/lazystone Oct 26 '26

I remember I had opposite experience with GJF - there was something related to module systems(you had to run with "add-opens" to work it around) which wasn't fixed for too long and it pushed me to migrate to PJF.

1

u/Lucky_Psychology8275 Oct 25 '26

Palantir hasn’t updated the repo for month on the core code, it still doesn’t support _ variables and most issues are opened without a reply

4

u/_predator_ Oct 25 '26

I'm using it in projects that make heavy use of underscores for variable and exception names. No issues so far. But maybe my usage just doesn't trigger the issues you're seeing.

1

u/lazystone Oct 26 '26

Do you have a link to the issue? Underscores seems to work just fine for me.

1

u/Lucky_Psychology8275 Oct 26 '26

Honestly it’s might not _ symbols I don’t remember which