Support :source-paths for Leiningen 2 compatibility.

This commit is contained in:
Phil Hagelberg 2012-03-04 14:09:50 -08:00
parent 975e692374
commit 04c3572921

View file

@ -3,11 +3,12 @@
[clojure.java.io :as io]
[jonase.kibit.core :as kibit]))
(defn kibit [project]
(let [namespaces (-> project
:source-path
io/file
ns/find-namespaces-in-dir)]
(defn kibit
"Suggest idiomatic replacements for patterns of code."
[project]
(let [paths (or (:source-paths project) [(:source-path project)])
namespaces (apply concat (for [path paths]
(ns/find-namespaces-in-dir (io/file path))))]
(doseq [ns-sym namespaces]
(try
(println "==" ns-sym "==")