Skip to content

Commit

Permalink
eastwood: support options in a config
Browse files Browse the repository at this point in the history
  • Loading branch information
totakke committed Feb 16, 2025
1 parent 898ea29 commit 647e4c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:eastwood
{:disabled? false
:version "1.4.3" ; default "RELEASE"
}
:options {:exclude-linters [:unused-ret-vals]}}

:flake8
{:disabled? false
Expand Down
15 changes: 8 additions & 7 deletions src/bosslint/linter/eastwood.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
(string/replace #"/" "."))))

(defn- eastwood-options
[files]
(->> (map :git-path files)
(map path->ns)
(string/join " ")
(format "{:namespaces [%s]}")))
[files additional-options]
(pr-str
(assoc (or additional-options {})
:namespaces (->> (map :git-path files)
(keep path->ns)
(map symbol)))))

(defn- aliases-with-extra-paths
[dir]
Expand All @@ -52,7 +53,7 @@
(if (zero? (process/run "clojure"
"-Sdeps" (clojure-sdeps version)
(str "-M" (string/join aliases))
(eastwood-options files)))
(eastwood-options files (:options conf))))
:success
:error)))

Expand All @@ -62,7 +63,7 @@
args ["lein"
"update-in" ":plugins" "conj" (format "[jonase/eastwood \"%s\"]" version)
"--" "eastwood"
(eastwood-options files)]]
(eastwood-options files (:options conf))]]
(if (zero? (apply process/run args))
:success
:error)))
Expand Down

0 comments on commit 647e4c1

Please sign in to comment.