Skip to content

Code Analysis

clj-kondo is a lint tool that highlights syntactic errors and suggests idioms for Clojure, ClojureScript and EDN.

Use clj-kondo with your preferred editor to warning about errors as you type so issues can be fixed as soon as they occur, enhancing your joy of Clojure.

clj-kondo can also be used as a command line tool for checking projects in development environments and continuous integration service, such as the setup-clojure GitHub action.

Clojure LSP includes clj-kondo

Clojure LSP install includes clj-kondo, removing the need for a separate install of clj-kondo

Install

Follow the clj-kondo install guide for your operating system.

Clj-kondo config contains additional configuration for using clj-kondo with libraries that extend the Clojure language via macros.

clj-kondo in Spacemacs

clj-kondo can be used if cider is configured as the clojure layer backend. If LSP is configured as the backend, should not be used as it may duplicate analysis results (e.g. doubling error and warning messgeas).

Use Clojure LSP with Doom rather than clj-kondo by itself.

Add the +lsp feature to the Clojure module and enable the lsp module

.config/doom/init.el
(clojure +lsp)
lsp
Add the respective LSP server implementation to the operating system

Use Mason to install clj-kondo as a linter.

Practicalli nvim-astro configuration includes Clojure LSP and clj-kondo, integrating these tools with LSP diagnostics.

Practicalli Neovim is a guide to configure and use Neovim for Clojure software development.

Command Line analysis

Run clj-kondo with the --lint option and specify a file or path

To analyse a specific file

clj-kondo --lint ~/.config/deps.edn

Analyse a project, running the clj-kondo command from the root of the project

clj-kondo --lint .