spacemacs

2FO 2022-11-26T17:27:34.187339Z

Howdy, Does anyone have a hook or method to auto format .clj buffers on save?

practicalli-johnny 2022-11-26T20:40:42.526339Z

Cider docs has a suggested hook example https://docs.cider.mx/cider/usage/misc_features.html#formatting-code-with-cljfmt

practicalli-johnny 2022-11-26T20:45:21.069839Z

Personally, most of my formatting is done automatically as I type, with either clojure-lsp or cider. I rarely have to format manually using the , = menu. I also use https://github.com/greglook/cljstyle binary to run a format check or format fix before committing a change to Git. That could be also be added a Git pre-commit hook, but I prefer to do it manually.

🙏 1