Merge pull request #37 from tsdh/master
Use check-file instead of check-reader.
This commit is contained in:
commit
710e67188a
3 changed files with 13 additions and 14 deletions
|
@ -226,5 +226,5 @@
|
|||
:rules rules
|
||||
:guard guard
|
||||
:resolution resolution)]
|
||||
(reporter simplify-map)))))
|
||||
(reporter (assoc simplify-map :file source-file))))))
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
(defn cli-reporter
|
||||
"Print a check-map to `*out*`"
|
||||
[check-map]
|
||||
(let [{:keys [line expr alt]} check-map]
|
||||
(do
|
||||
(printf "[%s] Consider:\n" line)
|
||||
(let [{:keys [file line expr alt]} check-map]
|
||||
(do
|
||||
(printf "At %s:%s:\nConsider using:\n" file line)
|
||||
(pprint-code alt)
|
||||
(println "instead of:")
|
||||
(pprint-code expr)
|
||||
|
|
|
@ -11,15 +11,14 @@
|
|||
(let [paths (or (:source-paths project) [(:source-path project)])
|
||||
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
|
||||
(->> (kibit/check-reader reader)
|
||||
#_(filter #(contains? % :alt))
|
||||
(map reporters/cli-reporter)
|
||||
doall)
|
||||
(catch Exception e
|
||||
(println "Check failed -- skipping rest of file")
|
||||
(println (.getMessage e))))))))
|
||||
(printf "== %s ==\n" (or (second (clj-ns/read-file-ns-decl source-file)) source-file))
|
||||
(try
|
||||
(->> (kibit/check-file source-file)
|
||||
#_(filter #(contains? % :alt))
|
||||
(map reporters/cli-reporter)
|
||||
doall)
|
||||
(catch Exception e
|
||||
(println "Check failed -- skipping rest of file")
|
||||
(println (.getMessage e)))))))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue