This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-30
Channels
- # adventofcode (27)
- # ai (1)
- # announcements (2)
- # aws (66)
- # babashka (2)
- # beginners (34)
- # calva (28)
- # cider (5)
- # clj-kondo (18)
- # clojure (16)
- # clojure-europe (4)
- # clojure-norway (2)
- # clojure-uk (3)
- # clojurescript (11)
- # code-reviews (23)
- # conjure (23)
- # core-logic (1)
- # cursive (12)
- # datalevin (1)
- # datomic (9)
- # introduce-yourself (3)
- # kaocha (3)
- # klipse (4)
- # malli (42)
- # midje (1)
- # minecraft (1)
- # missionary (4)
- # music (1)
- # nextjournal (10)
- # polylith (5)
- # re-frame (2)
- # reitit (1)
- # releases (1)
- # sci (126)
- # shadow-cljs (4)
- # sql (2)
- # tools-deps (11)
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.
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.this may or may not help, but cljstyle will do that for you automatically if you set it up as a file watcher
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. https://plugins.jetbrains.com/plugin/7177-file-watchers
git clone
cd cljfmt/cljfmt
lein native-image
# Check the binary
target/cljfmt check
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: https://cursive-ide.com/userguide/formatting.html#code-style-settings
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)
@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.