Skip to content

Commit

Permalink
Sort linters alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
totakke committed Mar 26, 2020
1 parent 2b0a8e3 commit 8c2f799
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/bosslint/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

(def version "0.2.1-SNAPSHOT")

(defn- list-linters []
(sort-by linter/name (descendants :bosslint/linter)))

(defn- assert-command [command]
(when-not (util/command-exists? command)
(throw (ex-info (str "Command not found: " command) {}))))
Expand Down Expand Up @@ -80,7 +83,7 @@
enabled-linter? (if (:linter options)
(comp (set (:linter options)) linter/name)
(constantly true))
linters (filter enabled-linter? (descendants :bosslint/linter))
linters (filter enabled-linter? (list-linters))
conf (if (:config options)
(config/load-config (:config options))
(config/load-config))]
Expand Down Expand Up @@ -123,7 +126,7 @@
[["-c" "--config CONFIG" "Specify a configuration file (default: $HOME/.bosslint/config.edn)"]
["-l" "--linter LINTER" "Select linter"
:assoc-fn (fn [m k v] (update m k #(conj (or % []) v)))
:validate [(set (map name (descendants :bosslint/linter)))]]
:validate [(set (map name (list-linters)))]]
["-v" "--verbose" "Make bosslint verbose during the operation"]
["-h" "--help" "Print help"]])

Expand Down Expand Up @@ -161,9 +164,7 @@
;;; linters

(defn linters-cmd [_]
(doseq [s (->> (descendants :bosslint/linter)
(map linter/name)
sort)]
(doseq [s (map linter/name (list-linters))]
(println s)))

;;; main
Expand Down

0 comments on commit 8c2f799

Please sign in to comment.