Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
There's a function for that!
branch: master

This branch is 281 commits behind jonase:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test/kibit/test
.gitignore
README.md
project.clj

README.md

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 while macro instead of if.

Usage

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

$ lein plugin install jonase/kibit 0.0.1

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 controle-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.

TODO

  • Figure out how to report line numbers.
  • 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.

Something went wrong with that request. Please try again.