Permalink
Browse files

Create a github flavored markdown reporter.

  • Loading branch information...
1 parent 65b9fda commit 64766de6d10af2d8fc10dcc370632daa32901883 @RyanMcG RyanMcG committed Feb 6, 2013
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/kibit/reporters.clj
View
@@ -26,7 +26,7 @@
println)))
(defn cli-reporter
- "Print a check-map to `*out*`"
+ "Print a check-map to `*out*` in plain text."
[check-map]
(let [{:keys [file line expr alt]} check-map]
(do
@@ -36,3 +36,19 @@
(pprint-code expr)
(newline))))
+(defn gfm-reporter
+ "Print a check-map to `*out*` in github flavored markdown."
+ [check-map]
+ (let [{:keys [file line expr alt]} check-map]
+ (printf "----\n##### `%s:%s`\nConsider using:\n" file line)
+ (println "```clojure")
+ (pprint-code alt)
+ (println "```")
+ (println "instead of:")
+ (println "```clojure")
+ (pprint-code expr)
+ (println "```")
+ (newline)))
+
+(def name-to-reporter {"markdown" gfm-reporter
+ "text" cli-reporter})

0 comments on commit 64766de

Please sign in to comment.