Is it more idiomatic to write Clojure code wide or deep? Should I keep forms on the top line and use the full width of the page, or split the form and increase the line count but reduce horizontal scanning?
Are there any rules or general guidance about when to wrap forms onto new lines, or is it largely a matter of taste and preference and being consistent?
But this is becoming pretty common in config files:
{
:deps { ;; <-- content behind the open-paren
org.clojure/clojure {:mvn/version "1.8.0"}
ring {:mvn/version "1.5.0"}
hiccup {:mvn/version "1.0.5"}
}
}
Anyway, here are my suggestions:
Ask this question by filing an issue in the Clojure Style Guide. Bozhidar will certainly have an opinion on this and reply, and will probably add some resulting guidelines. (Whether or not they are followed by the community is a different matter, but it’s good to have at least something to point to from someone heavily opinionated on these matters. If there’s an authority on this topic, it’s definitely him.)
Check out zprint to see what it does. It’s probably the most serious Clojure formatter I’ve seen. There are a lot of options, even coining some terms like hang and flow to describe some Clojure indentation idioms pretty well.