diff --git a/README.md b/README.md index 7a4523b..0532c7a 100644 --- a/README.md +++ b/README.md @@ -9,31 +9,37 @@ You don't have to have Leiningen to check your codebase anymore :-) Add the following to your `deps.edn`: ```clj -:aliases {:check {:extra-deps {athos/clj-check {:git/url "https://github.com/athos/clj-check.git" - :sha "0ca84df1357d71429243b99908303f45a934654c"}} - :main-opts ["-m" "clj-check.check"]}} +:aliases + {:check + {:extra-deps + {com.github.athos/clj-check + {:git/url "https://github.com/athos/clj-check.git" + :sha "9e9282a6455f58a2015d267ad503b812ec6cdeb3"}} + :exec-fn clj-check.check/check} ``` If your project has its codebase under some directories other than `src` (say `src/clj` and `src/cljc`), specify them as the command line arguments as follows: ```clj -:aliases {:check {... - :main-opts ["-m" "clj-check.check" "src/clj" "src/cljc"]}} +:aliases + {:check + {... + :exec-args + {:source-paths ["src/clj" "src/cljc"]}}} ``` Then, run `clj-check` via the declared alias: -For clj versions 1.10.1.697 and greater: - ``` -clj -M:check +clj -X:check ``` -For older versions: +OR +Run `clj-check` with CLI overrides ``` -clj -A:check +clj -X:check :source-paths "[\"src/clj\"]" ``` ## License diff --git a/src/clj_check/check.clj b/src/clj_check/check.clj index 87a1390..94ea710 100644 --- a/src/clj_check/check.clj +++ b/src/clj_check/check.clj @@ -17,17 +17,16 @@ (doto e .printStackTrace)))) (defn check - [source-paths] + [{:keys [source-paths] + :or {source-paths ["src"]}}] (let [namespaces (bultitude/namespaces-on-classpath :classpath (map io/file source-paths) :ignore-unreadable? false) - failures (count - (sequence - (comp (map check-ns) (remove nil?)) - namespaces))] + failures (count (keep check-ns namespaces))] (shutdown-agents) (when-not (zero? failures) (System/exit failures)))) -(defn -main [& source-paths] - (check (or (seq source-paths) ["src"]))) +(defn -main + [& source-paths] + (check {:source-paths source-paths}))