You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...is quite reliable in part because ns forms are a quite limited "DSL" without a lot of room for variations, significant whitespace, metadata, comments, quoting/unquoting etc
For most other Clojure code I wouldn't be too trigger-happy with code rewriting, as we currently don't directly use rewrite-clj, so it's not a technique we master.
Eventually we might have some rewrite-clj helpers/abstraction, allowing us to implement small formatters easily and reliably.
Also important to find the right rewrite-clj version - there's rewrite-clj, rewrite-cljs, and clj-kondo's vendored rewrite-clj which might be interesting
Context
Our lein-template adds
;; Please keep the dependencies sorted a-z.
before the:dependencies
-key in project.clj.There's benefits for sorting this list (friction-free merges, improves readability, ..)
Task
We need a formatter to sort the dependency list
Acceptance criteria
dependency sorting:
should be formatted to
:exclusion
sortingshould be formatted to
note the formatted newlines
Additional resources
inspiration for replacement of the :dependencies can be found here:
formatting-stack/src/formatting_stack/util/ns.clj
Line 59 in 2b7f0e5
sorting might be something like:
The text was updated successfully, but these errors were encountered: