cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
2020-10-09T11:33:26.147200Z

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

bozhidar 2020-10-09T13:55:08.147700Z

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

2020-10-09T14:21:48.148800Z

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]]}}

bozhidar 2020-10-09T15:55:35.149700Z

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

bozhidar 2020-10-09T15:57:11.150300Z

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

2020-10-09T15:58:55.150700Z

i see: the cider call would be here, right? https://github.com/clojure-emacs/cider/blob/1be3b89c00d9fe6d2b69e5b719d168e22d333a25/cider-client.el#L714

bozhidar 2020-10-09T16:36:09.152900Z

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

bozhidar 2020-10-09T16:36:35.153500Z

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