formatter icon indicating copy to clipboard operation
formatter copied to clipboard

Building blocks and discussion for building a common Clojure code formatter

Results 11 formatter issues
Sort by recently updated
recently updated
newest added
trafficstars

I, for one, start to think about indentation first thing when formatting is mentioned. So therefore this thread on that issue. As the plethora of [zprint](/kkinnear/zprint) indentation options show us...

Do we want to reorder ns forms to follow something like Stuart Sierra’s [style guide]( https://stuartsierra.com/2016/clojure-how-to-ns.html)? (I’m really in favour of this personally). If we do want to reorder ns...

I see that communication on this project appears to have slowed down, and as an unknown Clojure developer, that saddens me. So, I'd like to try to stoke the fire...

How many empty lines should go between forms? A few options here: * Don't touch this at all, leave any newlines between forms alone * One line between each form...

How should we deal with comments? Is there a difference between `;` and `;;`? Reading discussions of other people building source code formatters, comments came up many times as a...

Similar to #7 on formatting maps, how should let bindings be formatted? Should all of the `init-form`s (right hand side) be aligned, or have a ragged alignment? ```clj (let [a...

There are a few places where Clojure programs can accumulate trailing whitespace. In the listings below `|` denotes the end of the line. **At the ends of lines after source...

Should map values be aligned, or should they have a single space between keys and values? E.g.: ```clj {:a 1 :xyz 2} ;; or {:a 1 :xyz 2} ``` Do...

How should reader conditionals be formatted? Should the conditional itself be outdented so that the code flows better, or just treat it as a regular form?

Should there be a space between `#_` and the next form? What should happen with multiple `#_`s? I'm often pretty sloppy with `#_` when I'm writing them as they are...