kibit – static code analyzer for Clojure

kibit is a static code analyser for Clojure, ClojureScript, cljx and related dialects. Rather than concentrating on syntax errors, it looks for expressions that could be written more clearly using idiomatic Clojure functions and macros.

The analyser uses core.logic to match source code against predefined patterns. For example, it can suggest replacing an if expression with when where appropriate, or simplifying arithmetic expressions using functions such as inc. These suggestions help developers adopt familiar Clojure idioms and reduce unnecessary code.

kibit reads source code without macro expansion or evaluation. This makes it possible to analyse code without executing it, although its pattern-based approach can produce false positives when macros or locally redefined symbols change the meaning of an expression.

The project is in maintenance mode, with bug fixes and compatibility updates still possible but no major feature development planned. Splint provides a newer approach to style analysis, offering comparable rules with a faster and more extensible engine.

This is free and open source software.

Key Features

  • Uses core.logic to identify expressions that can be simplified.
  • Suggests idiomatic functions and macros as alternatives to verbose code.
  • Analyses individual source files, directories and complete projects.
  • Supports Clojure, ClojureScript, cljx and related source formats.
  • Automatically replaces recognised patterns in source files.
  • Interactive replacement mode allows developers to approve individual changes.
  • Plain text and GitHub Flavoured Markdown reporting.
  • Non-zero exit status when suggestions are found, suitable for automated quality checks.
  • Can be rerun when source files change using external development tools.
  • Integration with Emacs and Vim through supporting editor plugins.
  • Rules can be extended with additional code patterns.

Website: github.com/clj-commons/kibit
Support:
Developer: Jonas Enlund and contributors
License: Eclipse Public License v1.0

kibit is written in Clojure. Learn Clojure with our recommended free books and free tutorials.


Related Software

Clojure Linter Tools
kibitStatic code analyzer for Clojure, ClojureScript, cljx and other Clojure variants
JokerSmall Clojure interpreter, linter and formatter
EastwoodInspects namespaces and reports possible problems
clj-kondoStatic analyzer and linter for Clojure
clojure-lspLanguage server providing Clojure and ClojureScript tooling
SplintFocuses on style and code shape
CarveFind and remove unused functions and namespaces in Clojure
clj-dependAnalyse and enforce namespace dependencies in Clojure projects

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted