Open oakmac opened 1 year ago
Note for the future: we will have to adjust the node tree / "print from scratch" the ns form in order to accomplish sorting of :require
nodes. This will be tricky with comments; I think they will need to be "attached" to a require line and we will have to detect that and keep the comments when sorting.
This is a change from the rest of the algorithm where it basically "prints what it has, with adjustments" as opposed to the "print from scratch" approach.
How should the comment ; aaa
be formatted in the below example? It occurs outside of the ns
form.
(ns example
(:refer-clojure :only [get])) ; aaa
Should it be "attached" to the :refer-clojure
line or no? I think the answer is "no" because it exists outside of the ns
form.
In this example, it should be "attached" to the :refer-clojure
line:
(ns example
(:refer-clojure :only [get]) ; aaa
)
Update: I changed my mind about this. ; aaa
should be attached to the :refer-clojure
line in both cases.
The formatter should implement the rules from how to ns
:refer-clojure
:refer :all
use