Fork me on GitHub
#cider
<
2020-10-09
>
bruno.bonacci11:10:26

Hi, does anyone know if there is a way in Cider to provide a custom cljfmt formatting configuration?

bozhidar13:10:08

Custom in what sense? CIDER just runs cljfmt, so it should pick whatever configuration you have.

bruno.bonacci14:10:48

Where does cljfmt read the configuration from? I’d like to provide the following configuration

:cljfmt {:remove-consecutive-blank-lines? false
           :remove-surrounding-whitespace?  false
           :indents ^:replace {#".*"   [[:inner 0]]}}

bozhidar15:10:35

It seem you actually have to pass the configuration to the middleware. I had forgotten how that code looks.

bozhidar15:10:11

It also seems we didn't expose this through the existing format commands in CIDER.

bozhidar16:10:09

Yeah, that's the "low-level" request function, most of the user-facing code is in cider-format.el.

bozhidar16:10:35

It shouldn't be hard to change this. Probably we can expose the configuration through a defcustom.