From 647e4c174678de3ba64fa8252515e30c74cd551e Mon Sep 17 00:00:00 2001 From: Toshiki Takeuchi Date: Sun, 16 Feb 2025 20:30:03 +0900 Subject: [PATCH] eastwood: support options in a config --- example/config.edn | 2 +- src/bosslint/linter/eastwood.clj | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/example/config.edn b/example/config.edn index cfced82..4969f9a 100644 --- a/example/config.edn +++ b/example/config.edn @@ -23,7 +23,7 @@ :eastwood {:disabled? false :version "1.4.3" ; default "RELEASE" - } + :options {:exclude-linters [:unused-ret-vals]}} :flake8 {:disabled? false diff --git a/src/bosslint/linter/eastwood.clj b/src/bosslint/linter/eastwood.clj index 9c64ef5..3807915 100644 --- a/src/bosslint/linter/eastwood.clj +++ b/src/bosslint/linter/eastwood.clj @@ -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] @@ -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))) @@ -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)))