Skip to content

Commit

Permalink
Allow both a linter key and a linter name for -l option
Browse files Browse the repository at this point in the history
  • Loading branch information
totakke committed Jan 28, 2025
1 parent c8da9d0 commit 9a24621
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bosslint/main.clj
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@
["-C" "--directory DIR" "Specify an alternate working directory (default: .)"
:default "."]
["-l" "--linter LINTER" "Select linter"
:assoc-fn (fn [m k v] (update m k #(conj (or % []) v)))
:validate [(set (map name (list-linters)))]]
:assoc-fn (let [name-map (into {} (map (juxt linter/name name)
(list-linters)))]
(fn [m k v]
(update m k #(conj (or % []) (name-map v v)))))
:validate [(set (mapcat (juxt name linter/name) (list-linters)))
"Unsupported linter"]]
["-v" "--verbose" "Make bosslint verbose during the operation"]
["-h" "--help" "Print help"]])

Expand Down

0 comments on commit 9a24621

Please sign in to comment.