practicalli / blog-cryogen

Cryogen powered blog with all the content used to generate the static website.
https://practical.li/blog-cryogen/
3 stars 2 forks source link

article: Clojure format with cljstyle #153

Open practicalli-johnny opened 1 year ago

practicalli-johnny commented 1 year ago

Using cljstyle to format Clojure code

Rational

Using

check or fix

Configure

.cljstyle file (would be nice to be able to configure the location of this file)

key changes to support cljfmt style

Link to .cljstyle in practicalli/dotfiles repository

Summary

cljstyle is a binary so can be run anywhere, unlike cljfmt which is a libray and a leiningen plugin. So cljstyle is easier to install and use in more situations.

I found cljfmt very agressive and the configuration a little hard to understand without experimentation. cljstyle was much easier to understand and seems to have a much wider set of options. The default options are very close to that of the default cljfmt

I've raised an issue to add cljstyle to MegaLinter (and I'll check clj-kondo is using the latest version)