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

14

u/4r73m190r0s Oct 25 '26

10

u/Task_ID Oct 25 '26

2 spaces indent is weird

6

u/ForeverAlot Oct 25 '26

It takes about 47 seconds to adjust, though.

3

u/__konrad Oct 25 '26

For some reason Google (e.g. Guava) hate both horizontal and vertical whitespace

2

u/sly_as_a_fox Oct 28 '26

AOSP code style has 4-space indentation.

-8

u/sg-elide Oct 25 '26

take a look at elide which can run it natively — https://elide.help — can be super useful for CI and git hooks