jonase/kibit — pull request #71 by RyanMcG (2013-02-07 00:52:04+00:00)
Title: Add GFM reporter, Allow user to select reporter with CL option

I am truly sorry about the dense title, I was trying to be concise.

This pull request is an attempt to implement a few things:

1. Add a reporter that outputs github flavored markdown.
2. Add reporter output tests.
3. Allow the user to select which reporter to use ('"text" or "markdown").

Usage:

```bash
lein kibit --reporter markdown
```
Or

```bash
lein kibit -r text
```

If the given argument does not match a reporter the plain text (cli-reporter) is used.

**Suggestions, criticisms and hints are more than welcome!**

### Example Output:

Below is some sample output on some code I need to update. Apparently I did not know about `when-not`.

----
##### `/home/ryan/repo/Cadence/src/cadence/model.clj:63`
Consider using:
```clojure
(update-in user-map [:roles] namespace-and-keywordize-roles)
```
instead of:
```clojure
(assoc
user-map
:roles
(namespace-and-keywordize-roles (:roles user-map)))
```

----
##### `/home/ryan/repo/Cadence/src/cadence/model.clj:136`
Consider using:
```clojure
(when-not (nil? result)
(mc/update-by-id
"phrases"
(:_id result)
{$set {:random_point [(rand) 0]}}))
```
instead of:
```clojure
(when (not (nil? result))
(mc/update-by-id
"phrases"
(:_id result)
{$set {:random_point [(rand) 0]}}))
```

----
##### `/home/ryan/repo/Cadence/src/cadence/model/validators.clj:18`
Consider using:
```clojure
(when (has-value? name)
(rule
(min-length? name 3)
[:name "Your name must be at least 3 characters long."])
(rule
(max-length? name 64)
[:name "Your name must be no more than 64 characters long."])
(rule
(re-find #"^[a-zA-z][\-'\w]*( [\-'\w]+)*\w$" name)
[:name
(str
"Your name must match this regex "
"/^[a-zA-z][\\-'\\w]*( [\\-'\\w]+)*\\w$/")]))
```
instead of:
```clojure
(when (has-value? name)
(do
(rule
(min-length? name 3)
[:name "Your name must be at least 3 characters long."])
(rule
(max-length? name 64)
[:name "Your name must be no more than 64 characters long."])
(rule
(re-find #"^[a-zA-z][\-'\w]*( [\-'\w]+)*\w$" name)
[:name
(str
"Your name must match this regex "
"/^[a-zA-z][\\-'\\w]*( [\\-'\\w]+)*\\w$/")])))
```

----
##### `/home/ryan/repo/Cadence/src/cadence/model/validators.clj:46`
Consider using:
```clojure
(set (keys eve))
```
instead of:
```clojure
(into #{} (keys eve))
```

----
##### `/home/ryan/repo/Cadence/src/cadence/model/validators.clj:56`
Consider using:
```clojure
(set (keys cadence))
```
instead of:
```clojure
(into #{} (keys cadence))
```

----
##### `/home/ryan/repo/Cadence/src/cadence/views/common.clj:88`
Consider using:
```clojure
(when-not (friend/anonymous?)
(html
[:li [:a {:href "/user/training"} "Training"]]
[:li [:a {:href "/user/auth"} "Auth"]]))
```
instead of:
```clojure
(when (not (friend/anonymous?))
(html
[:li [:a {:href "/user/training"} "Training"]]
[:li [:a {:href "/user/auth"} "Auth"]]))
```

----
##### `/home/ryan/repo/Cadence/src/cadence/views/common.clj:139`
Consider using:
```clojure
(when-not (nil? errors) (format-errors errors))
```
instead of:
```clojure
(when (not (nil? errors)) (format-errors errors))
```