clj-kondo – static analyzer and linter for Clojure

Clj-kondo performs static analysis on Clojure, ClojureScript and EDN. It informs you about potential errors while you are typing (without executing your program).

This linter is:

  • compatible with .clj, .cljs, .cljc and .edn files.
  • build tool and editor agnostic.
  • a static code analyzer.
  • compiled to native code using GraalVM.

This is free and open source software.

Key Features

Detects:

  • inline def expressions.
  • redundant do and let wrappings.
  • arity errors:
    • within the same namespace and across namespaces.
    • of static Java method calls.
    • of local let and letfn binding calls.
    • of recursive calls (including recur).
    • conflicting arities in overloaded functions.
  • unused private vars.
  • private and deprecated var usage.
  • required but unused namespaces.
  • unsorted required namespaces.
  • referred but unused vars.
  • duplicate requires.
  • unused function arguments and let bindings.
  • marked as unused, but used arguments and let bindings (optional).
  • unused imports.
  • redefined vars.
  • unresolved symbols, vars and namespaces.
  • misplaced docstrings.
  • duplicate map keys and set elements.
  • duplicates and quoting in case test constants.
  • missing map keys.
  • invalid number of forms in binding vectors.
  • missing assertions in clojure.test/deftest
  • alias consistency.
  • type checking.
  • Datalog syntax checking.
  • format string argument mismatches.
  • shadowed vars.
  • 2 argument usage of reduce (optional).

before your form hits the REPL.

It suggests several style guide recommendations, such as:

  • rules from Stuart Sierra’s how to ns.
  • use :else as the catch-all test expression in cond.
  • use seq instead of (not (empty? ,,,)).
  • don’t make your lines too long.
  • Cross-platform support – runs on Linux, macOS, and Windows.

Website: github.com/clj-kondo/clj-kondo
Support:
Developer: Michiel Borkent
License: Eclipse Public License v1.0

clj-kondo 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