Fixed the plugin, removed plugin opts for now

This commit is contained in:
Jonas Enlund 2012-03-28 16:11:34 +03:00
parent 337da5049a
commit 308e638ba6

View file

@ -9,19 +9,17 @@
"Suggest idiomatic replacements for patterns of code."
[project & opts]
(let [paths (or (:source-paths project) [(:source-path project)])
source-files (mapcat #(-> % io/file clj-ns/find-clojure-sources-in-dir) paths)
kw-opts (apply hash-map (map read-string opts))
verbose (or (:verbose kw-opts) false)
check (if verbose kibit/check-subforms kibit/check-toplevel-forms)]
source-files (mapcat #(-> % io/file clj-ns/find-clojure-sources-in-dir) paths)]
(doseq [source-file source-files]
(with-open [reader (io/reader source-file)]
(printf "== %s ==\n" (or (second (clj-ns/read-file-ns-decl source-file)) source-file))
(try
(->> (check reader rules/all-rules)
(filter #(contains? % :alt))
(->> (kibit/check-reader reader)
#_(filter #(contains? % :alt))
(map reporters/cli-reporter)
doall)
(catch Exception e
(println "Check failed -- skipping rest of file")
(when verbose (.printStackTrace e))))))))
(println (.getMessage e))))))))