Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create a github flavored markdown reporter.

  • Loading branch information...
commit 64766de6d10af2d8fc10dcc370632daa32901883 1 parent 65b9fda
@RyanMcG RyanMcG authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/kibit/reporters.clj
View
18 src/kibit/reporters.clj
@@ -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})
Please sign in to comment.
Something went wrong with that request. Please try again.