Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We've just gone the deterministic code formatter route on everything. Right off the top of my head:

- C/C++: `clang-format` is great - Rust: `rustfmt` is very good - Python: `yapf` is very good - Java: `google-java-formatter` is pretty good - Haskell: `fourmolu` is OK, and if you apply it first and then `stylish-haskell` it's good enough - Starlark - `buildifier` is great - Shell: `shfmt` is pretty good - Nix: `nixfmt` is pretty good

I haven't done any JS or TypeScript or golang in awhile, but I'm sure there are great options there too.

By having all the auto-formatters, we can have one golden config that's fully deterministic for upstream, but everyone can have their own if they want and it just gets blasted into the "golden" format before code review.

Finally, a world without brace wars! Everyone tabs and spaces and whatever to their hear's content. Everyone's happy!

* you do eat the blame getting fucked up the one time. it's worth it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: