Invoke clj-kondo from babashka scripts!
Add this dependency to bb.edn
or deps.edn
(for bb libraries):
{:deps {io.github.clj-kondo/clj-kondo-bb {:git/tag "v2023.01.20" :git/sha "adfc7df"}}}
You can invoke clj-kondo as a babashka one-liner like this:
bb -Sdeps '{:deps {io.github.clj-kondo/clj-kondo-bb ...}}' -x clj-kondo.core/exec --lint src
You can add this library along with JVM clj-kondo without causing conflicts.
In a babaska script:
(require '[clj-kondo.core :as clj-kondo])
(let [{:keys [summary] :as results} (clj-kondo/run! {:lint ["src"]})]
(clj-kondo/print! results)
(when (or (pos? (:warning summary))
(pos? (:error summary)))
(throw (ex-info "Lint errors" {:babashka/exit 1}))))
Copyright © 2019 - 2023 Michiel Borkent
Distributed under the EPL License, same as Clojure. See LICENSE.