Yesterday I’ve found out about ZPrint and after following this thread I decided to build Node CLI around the library to use it in editors like Atom, VS Code, etc.
zprint-clj is Node-based CLI that provides public API for editor integration
zprint-atom is Atom plugin
- VS Code plugin ?
Here’s some results for formatting time on files of different size
As author of ZPrint noted, the time spent on formatting actually depends on how deep the code is and usage of complex construct like destructuring syntax, etc.
I want to get a feedback on these. Try it or build an integration for your editor
For context, zprint is a tool to reformat Clojure(Script) tool. Compared to the lighter cljfmt, it takes a more aggressive approach, including the introduction (or I think removal) of newlines when necessary.
Personally I think it’s a pretty amazing piece of software. It includes presets for lots of common functions and macros, and it can also be configured if those defaults don’t match your taste. If you select “community style”, it tries to adhere closely to the highly regarded Clojure Style Guide.
I did not know of zprint and it’s pretty cool
I really like zprint’s ability to specify formatting options inline to handle special cases for formatting some forms for which you wouldn’t want to find a generalization: https://github.com/kkinnear/zprint/blob/master/doc/bang.md#example----turn-off-vector-wrap-for-a-single-definition