cljfmt is a code formatting utility for detecting and correcting stylistic inconsistencies in Clojure source files. Its default formatting rules follow the Clojure Style Guide, but developers can customise them to match their project’s conventions.
Rather than completely reconstructing source code from its syntax tree, cljfmt aims to make relatively small changes to existing text. This helps preserve the structure of code that is already reasonably formatted while correcting whitespace, indentation and other inconsistencies.
The formatter can be operated from the command line, integrated with Clojure build tools or used as a library. It is suitable for individual developers and teams seeking consistent source formatting across an entire project.
This is free and open source software.
Key Features
- Detects and fixes formatting errors in Clojure source code.
- Uses formatting defaults based on the Clojure Style Guide.
- Corrects indentation and applies configurable indentation rules to functions and macros.
- Removes unnecessary surrounding and trailing whitespace.
- Inserts missing whitespace between Clojure forms.
- Normalises consecutive blank lines and can control spacing between top-level forms.
- Supports optional alignment of map entries and selected function arguments.
- Can rewrite namespace declarations and optionally sort namespace references.
- Allows individual formatting rules to be enabled, disabled or customised.
- Supports different function argument indentation conventions, including community, Cursive and zprint styles.
- Provides check and fix commands for validating or correcting source files.
- Can recursively process files within project directories.
- Supports project configuration through .cljfmt.edn and cljfmt.edn files.
- Provides a library API for formatting strings and checking or fixing files programmatically.
- Integrates with Leiningen, Clojure CLI, Babashka and supported code editors.
- Cross-platform support – runs on Linux, macOS, and Windows.
Website: github.com/weavejester/cljfmt
Support:
Developer: James Reeves
License: Eclipse Public License v1.0

cljfmt is written in Clojure. Learn Clojure with our recommended free books and free tutorials.
Related Software
| Clojure Code Formatters | |
|---|---|
| cljfmt | Tool for detecting and fixing formatting errors in Clojure code |
| Joker | Small Clojure interpreter, linter and formatter |
| zprint | Reformat Clojure and Clojurescript source code |
| cljstyle | Supports several different commands for checking source files. |
| Standard Clojure Style | JavaScript implementation of a formatter for Clojure source code |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.