Fork me on GitHub
#find-my-lib
<
2021-08-25
Jakub Holý (HolyJak)13:08:05

What do people use to enforce consistent indentation in clj files? I guess cljfmt can do it, but is there something else, preferably something minimalistic? Thanks!

borkdude13:08:20

there's also cljstyle (which builds on cljfmt)

vemv13:08:41

cljfmt is minimalistic in that it's quite lenient, it doesn't try canonalicazing your codebase it also nearly matches Emacs' default settings. Which is why it's used in https://github.com/clojure-emacs/ CI

vemv13:08:18

in a couple teams in a row we're all Emacs users so our minimalism can go as far as using no external formatter at all 😄 it still can help to catch the occasional misconfiguration

borkdude13:08:46

we don't use any whitespace enforcement in my current job and somehow that's not a problem for us, perhaps because our team uses mainly emacs, vscode and cursive, which perhaps all behave the same out of the box (like cljfmt) and Cursive can be tweaked to do so (I think our Cursive user mentioned this)

Jakub Holý (HolyJak)17:08:10

Thank you! Somehow our codebase has incorrect indentation (despite some folks using Emacs :)), which prevents me from using Parinfer. I will have a look at what cljfmt would do to the sources....