File tree Expand file tree Collapse file tree 1 file changed +43
-1
lines changed Expand file tree Collapse file tree 1 file changed +43
-1
lines changed Original file line number Diff line number Diff line change 136
136
(expect (buffer-string ) :to-equal
137
137
" (ns my-app.core
138
138
(:require [my-app.views [user-page :as user-page]]
139
- [rum.core :as rum] ;comment\n ))" )))
139
+ [rum.core :as rum] ;comment
140
+ ))" )))
141
+
142
+ (it " should sort requires in a basic ns with comments in the end"
143
+ (with-clojure-buffer " (ns my-app.core
144
+ (:require [rum.core :as rum] ;comment
145
+ [my-app.views [user-page :as user-page]]
146
+ ;;[comment2]
147
+ ))"
148
+ (clojure-sort-ns)
149
+ (expect (buffer-string ) :to-equal
150
+ " (ns my-app.core
151
+ (:require [my-app.views [user-page :as user-page]]
152
+ [rum.core :as rum] ;comment
153
+
154
+ ;;[comment2]
155
+ ))" )))
156
+ (it " should sort requires in ns with copyright disclamer and comments"
157
+ (with-clojure-buffer " ;; Copyright (c) John Doe. All rights reserved.
158
+ ;; The use and distribution terms for this software are covered by the
159
+ ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
160
+ (ns clojure.core
161
+ (:require
162
+ ;; The first comment
163
+ [foo] ;; foo comment
164
+ ;; Middle comment
165
+ [bar] ;; bar comment
166
+ ;; A last comment
167
+ ))"
168
+ (clojure-sort-ns)
169
+ (expect (buffer-string ) :to-equal
170
+ " ;; Copyright (c) John Doe. All rights reserved.
171
+ ;; The use and distribution terms for this software are covered by the
172
+ ;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
173
+ (ns clojure.core
174
+ (:require
175
+ ;; Middle comment
176
+ [bar] ;; bar comment
177
+ ;; The first comment
178
+ [foo] ;; foo comment
179
+
180
+ ;; A last comment
181
+ ))" )))
140
182
141
183
(it " should also sort imports in a ns"
142
184
(with-clojure-buffer " \n (ns my-app.core
You can’t perform that action at this time.
0 commit comments