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.
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
- Read the clj-kondo findings and correct the flagged code.
- Run the formatter to rewrite files to the expected style.
- Re-run the check steps so they exit zero.
clj-kondo --lint src
cljfmt fix # or: cljstyle fixGate consistently in CI
Run the same check commands CI uses locally so drift is caught before the push.
clj-kondo --lint src test
cljfmt checkHow 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.