No description
Find a file
2012-03-15 15:30:20 -07:00
src Removed anononymous fn rules 2012-03-15 21:47:13 +02:00
test/kibit/test Tests to make sure I never break the seq code again 2012-03-09 09:08:31 -05:00
.gitignore A more robust gitignore 2012-03-05 12:37:50 -05:00
project.clj inc version to 0.0.3-SNAPSHOT 2012-03-10 15:00:13 +02:00
README.md Correct link to control_structures.clj in README 2012-03-15 15:30:20 -07:00

kibit

There's a function for that!

kibit is a static code analyzer for Clojure which uses the core.logic unifier to search for patterns of code for which there might exist a more idiomatic function or macro. For example if kibit finds the code

(if (some test)
  (some action)
  nil)

it will make the suggestion to use the when macro instead of if.

Usage

Add [jonase/kibit "0.0.2"] to your :plugins vector in your :user profile (Leiningen 2) or if you are using Leiningen 1:

$ lein plugin install jonase/kibit 0.0.2

Then you can run

$ lein kibit

to analyze your namespaces.

Contributing

It is very easy to write new patterns for kibit. Take a look at control-structures.clj to see how new patterns are created. If you know of a recurring pattern of code that can be simplified, please consider sending me a pull request.

Bugs can be reported using the github bug tracker.

Contributors

  • Jonas Enlund
  • Phil Hagelberg
  • Alan Malloy
  • Paul deGrandis

TODO

  • Rules for function definitions (make this more of a lint tool)
  • Rules for collection lookup; "2 is a bad smell" see this blog post
  • Extract the "when to use" rules from Joy of Clojure
  • gh-pages of the Marginalia docs as done here
  • Leiningen project.clj setting for rule exclusion
  • Leiningen project.clj setting for a directory of rules to include
  • More rules
  • Remove reflection warnings (how?)
  • Can core.logic be used to its full potential?
  • Analyse ClojureScript files?

License

Copyright © 2012 Jonas Enlund

Distributed under the Eclipse Public License, the same as Clojure.