greglook / cljstyle

A tool for formatting Clojure code
Eclipse Public License 1.0
293 stars 39 forks source link

Support "indent like" configuration #60

Open robhanlon22 opened 4 years ago

robhanlon22 commented 4 years ago

clj-kondo has a nice feature where you can configure it to lint a particular macro as if it were a different macro, so you don't have to write custom linters for macros if they're not necessary. That got me thinking—it would be really nice if cljstyle supported something like that in the :indents configuration, e.g.

;; .cljstyle
{:indents {def-special-fn defn}}

Would indent def-special-fn like defn. It might even be worth adding a new configuration key so you could opt into certain special formats, as the example above wouldn't format its arg vector liked defn.

greglook commented 4 years ago

Yup! I have been playing with a similar idea; this and a few other issues have led me to want to revamp how cljstyle config is structured to make it more rule-focused instead of a large flat map. Unfortunately I haven't had a lot of spare time to work on this lately (puppies are hard 😭) but I'm hoping to get it done this month.

robhanlon22 commented 4 years ago

Yup! I have been playing with a similar idea; this and a few other issues have led me to want to revamp how cljstyle config is structured to make it more rule-focused instead of a large flat map. Unfortunately I haven't had a lot of spare time to work on this lately (puppies are hard 😭) but I'm hoping to get it done this month.

PUPPIES