weavejester / cljfmt

A tool for formatting Clojure code
Eclipse Public License 1.0
1.11k stars 120 forks source link

Support specifying :default spec in custom indentation rules #347

Closed camsaul closed 1 month ago

camsaul commented 1 month ago

Sometimes the default fuzzy rule for ^with- of [[:inner 0]] is inappropriate, for example if you had a function like

(defn with-timezone [t zone]
  ...)

;;; this is a regular function and should follow `:default` list indentation rules
(with-timezone (java.time.OffsetDateTime/now)
               "US/Pacific")

This PR adds support for explicitly specifying :default formatting for a specific symbol

weavejester commented 1 month ago

Thanks for the PR. This seems like a useful addition. Can you change the commit message to:

Add ':default' custom indentation rule

This puts it under 50 characters.

camsaul commented 1 month ago

@weavejester done

weavejester commented 1 month ago

Merged. Thanks for the work (again!)