an idempotent formatter, a rule-based linter and a language server
/for Scheme, Racket, Emacs Lisp and Common Lisp/
https://github.com/jjba23/sift
After quite some years of dreaming of something like this, and attempting it to several degrees of success (initially some ELisp hackery to lint my Guile and Elisp), and after spending the last month working hard on it, designing, testing, defining rules, implementing, sparring with LLM, I have come to a really feature-full and complete, performant, good language server, formatter and linter for many Lisp dialects.
It is already enhancing my day-to-day work, my hobby projects, my day job and I already have friends using it to clean up their Lisp projects and improve them with the batteries-included sift. It also comes with a WASM playground for you to get a little taste of it (and for me to taste Guile Hoot)
Also available a more in-depth dive in Sift, in my blog: https://jointhefreeworld.org/blog/articles/lisps/sift-the-lisp-formatter-i-kept-trying-to-write/
In an nutshell It is one Guile 3.0 program: no build step, no C dependency, no runtime to install.
It reads a Lisp file (several dialects), reports what is ill-formed in it, and rewrites its whitespace without losing a byte. It is also a language server and a WebAssembly build, so the CLI, the tab and the editor are all 1 exact same code path.
Hardened by construction
95 rules, 119 test suites, 1,160 tests, 2,624 assertions.
Formatting is a fixed point, asserted over every fixture, per dialect and per style. "Run the formatter twice" cannot reflow your file.
The architecture is what keeps it relatively small.
One rule is one record in one module: a walker, a sentence, the dialects it applies to, an example and a fix.
Everything else like the catalogue page, the sift explain text, the rules browser on the site, the editor's code actions — is generated from that record, and a test fails when the generated document and the code disagree.
Documented from the source
The API reference is generated with guile-dokgen from the modules themselves: 388 exported procedures, diagrams included, republished on every push. It cannot drift from the code, because it is the code.
The rule catalogue — 95 rules, each with the finding, the fix and the dialects it claims — is produced from the checker records, and the suite fails if doc/rules.org is not exactly what the code produces.
Every rule is readable offline with sift explain RULE, or M-x sift-explain-at-point in Emacs.
If you write Scheme, Racket, Elisp or CL and something looks wrong, the most useful thing you can send is the smallest file that reproduces it.