Fork me on GitHub

CLJC static analysis doesn’t seem to work correctly for me now...? I have a worse example, but this should be enough (cannot resolve s in the CLJS part):


Yeah, the static analysis sometimes struggles with CLJC, especially around interop. I’m planning to look at this soon since CLJC is about to get more complicated with ClojureDart.

👍 2

Thanks a lot, Colin.

Colin P. Hill16:12:17

Is there any way in the code style options to reformat this

(filter even?
  (range 1 10))
into this?
(filter even?
        (range 1 10))
At my company, we use cljfmt to enforce this code style in CI, and I haven't been able to figure out how to replicate it in Cursive's settings.

Jordan Robinson16:12:17

this may or may not help, but cljstyle will do that for you automatically if you set it up as a file watcher

Jordan Robinson16:12:32

problem being that cljfmt has very different rules apart from that one, so you may need to disable basically everything else


I use cljfmt with File Watchers plugin to format a file on save. You can build cljfmt as a native binary using GraalVM.

git clone 
cd cljfmt/cljfmt
lein native-image

# Check the binary
target/cljfmt check

💡 1
Colin P. Hill17:12:22

Ahh, never played with Graal and didn't think of it. I'll try that, thank you!


@U029J729MUP You’ll want to set the indent for filter to “Function” - see:


You’ll want to do that even if you use the File Watcher workaround, because the internal formatter is used for a lot of things (e.g. where the caret goes on the new line when you press enter)

Colin P. Hill12:12:14

@U0567Q30W My issue was actually that I had this enabled (pretty sure it was the default). Took me a while to try unchecking it because it wasn't clear to me what "only indent" meant.


Oh, yes, that would do it. It’s not on by default, but even if you have it on you can override it for particular forms. But if you want to match cljfmt you want that off, for sure.