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.
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. |


Please read our Comment Policy before commenting.