Skip to content
Latchkey

Clojure lint failing the build: clj-kondo / cljfmt / cljstyle in CI

Clojure lint and format tools exit non-zero when they find problems so they can gate CI. clj-kondo returns non-zero on error-level findings; cljfmt check and cljstyle check return non-zero when files are not formatted. The step failing means the checks did their job.

What this error means

A lint or format step fails: clj-kondo prints "linting took Nms, errors: K" with a non-zero exit, or cljfmt/cljstyle report files that would be reformatted.

clj
src/myapp/core.clj:12:3: error: Unresolved symbol: foo
linting took 340ms, errors: 1, warnings: 0
1 file(s) formatted incorrectly (cljfmt check)

Common causes

clj-kondo found error-level issues

Unresolved symbols, wrong arities, or unused requires at error level make clj-kondo exit non-zero and fail the gate.

Formatting drift from cljfmt or cljstyle

Files that do not match the configured format make cljfmt check or cljstyle check return non-zero.

How to fix it

Fix findings and reformat

  1. Read the clj-kondo findings and correct the flagged code.
  2. Run the formatter to rewrite files to the expected style.
  3. Re-run the check steps so they exit zero.
Terminal
clj-kondo --lint src
cljfmt fix        # or: cljstyle fix

Gate consistently in CI

Run the same check commands CI uses locally so drift is caught before the push.

Terminal
clj-kondo --lint src test
cljfmt check

How to prevent it

  • Run clj-kondo and the formatter locally or in a pre-commit hook.
  • Keep a shared clj-kondo config and cljfmt/cljstyle settings in the repo.
  • Treat lint and format checks as required, fixed before merge.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →