Skip to content
This repository
Newer
Older
100644 98 lines (70 sloc) 2.964 kb
c2c2d791 »
2012-03-04 Initial commit
1 # kibit
2
3 *There's a function for that!*
4
4734a1ba »
2012-04-01 Release 0.0.3
5 `kibit` is a static code analyzer for Clojure which uses
6 [`core.logic`](https://github.com/clojure/core.logic) to search for
7 patterns of code for which there might exist a more idiomatic function
8 or macro. For example if kibit finds the code
c2c2d791 »
2012-03-04 Initial commit
9
10 (if (some test)
11 (some action)
12 nil)
13
814e45d4 » amalloy
2012-03-05 Fix two typos in README
14 it will make the suggestion to use the `when` macro instead of `if`.
c2c2d791 »
2012-03-04 Initial commit
15
16 ## Usage
17
ebb2ffe9 »
2012-05-20 Release 0.0.4
18 Add `[jonase/kibit "0.0.4"]` to your `:plugins` vector in your `:user`
3627ba87 » technomancy
2012-03-04 Update installation instructions.
19 profile (Leiningen 2) or if you are using Leiningen 1:
c2c2d791 »
2012-03-04 Initial commit
20
ebb2ffe9 »
2012-05-20 Release 0.0.4
21 $ lein plugin install jonase/kibit 0.0.4
c2c2d791 »
2012-03-04 Initial commit
22
3627ba87 » technomancy
2012-03-04 Update installation instructions.
23 Then you can run
c2c2d791 »
2012-03-04 Initial commit
24
3627ba87 » technomancy
2012-03-04 Update installation instructions.
25 $ lein kibit
c2c2d791 »
2012-03-04 Initial commit
26
27 to analyze your namespaces.
28
3a2e8520 » tsdh
2012-05-31 Document Emacs usage in README.md
29 ### Usage from inside Emacs
30
5f3fc0cf »
2012-06-11 Mention limitations in README
31 If you use Emacs for hacking Clojure, here's a way to use kibit from
32 inside Emacs with all the fancyness you are used from `M-x compile`.
33 Put the following into your `~/.emacs`:
3a2e8520 » tsdh
2012-05-31 Document Emacs usage in README.md
34
35 ```
36 ;; Teach compile the syntax of the kibit output
37 (require 'compile)
38 (add-to-list 'compilation-error-regexp-alist-alist
39 '(kibit "At \\([^:]+\\):\\([[:digit:]]+\\):" 1 2 nil 0))
40 (add-to-list 'compilation-error-regexp-alist 'kibit)
41
5f3fc0cf »
2012-06-11 Mention limitations in README
42 ;; A convenient command to run "lein kibit" in the project to which
43 ;; the current emacs buffer belongs to.
3a2e8520 » tsdh
2012-05-31 Document Emacs usage in README.md
44 (defun kibit ()
45 "Run kibit on the current project.
46 Display the results in a hyperlinked *compilation* buffer."
47 (interactive)
48 (compile "lein kibit"))
49
7a4d2bfc »
2012-06-11 fixed readme
50 ```
51
52 This will give you a new command `M-x kibit RET`, and the properly
5f3fc0cf »
2012-06-11 Mention limitations in README
53 highlighted and hyperlinked kibit output is presented in a
54 `*compilation*` buffer.
55
56 ## Known limitations
57
58 Kibit
59 [reads](http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read)
60 source code without any macro expansion or evaluation. A macro can
61 therefor easily invalidate a rule. Also, kibit will not know if the
62 symbol `+` in the form `(+ x 1)` actually refers to a local or to a
63 function in a namespace other than `clojure.core`. Expect
64 some false positives.
3a2e8520 » tsdh
2012-05-31 Document Emacs usage in README.md
65
c2c2d791 »
2012-03-04 Initial commit
66 ## Contributing
67
92bd48f4 »
2012-03-04 README update
68 It is very easy to write new patterns for `kibit`. Take a look at
095c23f3 »
2012-04-01 Update README.md
69 [`control-structures.clj`](https://github.com/jonase/kibit/blob/master/src/kibit/rules/control_structures.clj)
9e135793 »
2012-03-04 README typo
70 to see how new patterns are created. If you know of a recurring
92bd48f4 »
2012-03-04 README update
71 pattern of code that can be simplified, please consider sending me a
72 pull request.
c2c2d791 »
2012-03-04 Initial commit
73
74 Bugs can be reported using the github bug tracker.
75
a293482a » ohpauleez
2012-03-05 Beefed up the readme; more todos; added contributors
76 ## Contributors
77
78 * Jonas Enlund
79 * Phil Hagelberg
75ff91ad » tsdh
2012-05-30 add me to contributors
80 * Tassilo Horn
a293482a » ohpauleez
2012-03-05 Beefed up the readme; more todos; added contributors
81 * Alan Malloy
82 * Paul deGrandis
9cec3ee1 » ohpauleez
2012-03-26 Match outer forms first - from Kevin's issue #23
83 * Kevin Lynagh
a293482a » ohpauleez
2012-03-05 Beefed up the readme; more todos; added contributors
84
c2c2d791 »
2012-03-04 Initial commit
85 ## TODO
86
a293482a » ohpauleez
2012-03-05 Beefed up the readme; more todos; added contributors
87 * Rules for function definitions (make this more of a lint tool)
88 * Rules for collection lookup; "2 is a bad smell" [see this blog post](http://tech.puredanger.com/2011/10/12/2-is-a-smell/)
89 * Extract the "when to use" rules from [Joy of Clojure](http://joyofclojure.com/)
90 * Leiningen project.clj setting for rule exclusion
91 * Leiningen project.clj setting for a directory of rules to include
f71b2e2f » ohpauleez
2012-03-21 Cleaned up stale TODO tasks
92 * Analyse ClojureScript files
c2c2d791 »
2012-03-04 Initial commit
93
94 ## License
95
3627ba87 » technomancy
2012-03-04 Update installation instructions.
96 Copyright © 2012 Jonas Enlund
c2c2d791 »
2012-03-04 Initial commit
97
98 Distributed under the Eclipse Public License, the same as Clojure.
a293482a » ohpauleez
2012-03-05 Beefed up the readme; more todos; added contributors
99
Something went wrong with that request. Please try again.