cursive

Yevgeni Tsodikov 2026-02-03T10:58:53.399659Z

Hey, Is there a way to integrate any formatting tool like cljstyle or cljfmt into the IDE, in a way that's reproducible in an isolated CI as well? Is there another tool people use for this purpose?

danieroux 2026-02-04T08:04:46.785389Z

We found bliss with: https://tonsky.me/blog/clojurefmt With something like this `.cljfmt.clj`:

^{:reference/url ""}
{:indents                         {#".*" [[:inner 0]]}}
With this Cursive config:

danieroux 2026-02-04T08:07:59.202499Z

<code_scheme name="Default" version="173">
  <ClojureCodeStyleSettings>
    <option name="alignBindingForms" value="true" />
    <option name="defaultOnlyIndent" value="true" />
    <option name="forceOnlyIndent" value="true" />
  </ClojureCodeStyleSettings>
</code_scheme>
Our committed config/codestyles/Default.xml

onetom 2026-02-03T11:08:31.828519Z

we made an attempt to integrate https://clojureverse.org/t/introducing-standard-clojure-style/10980 but i can't recall the details why that effort has fizzled. what i do remember: 1. there were some bugs in the implementation, but those were squashed quickly 2. i didn't quite like that fact that we had to pull in a js env just for the formatting 3. we still had to adjust some of the code, so intellij+cursive doesn't fight with it, e.g., put a smiley at the end of rich-comment blocks, so the trailing paren is not "slurped" up to the last sexp in the comment form, iirc

(comment
  (some code)

  :-)
but we should really solve this once and for all, because now the AI agents keep "mis-formatting" our code too... facepalm

onetom 2026-02-03T11:14:58.369229Z

also, if u want to rely on some external formatter, the cursor position might not be maintained. in emacs, there is a package to circumvent this problem https://github.com/radian-software/apheleia (but i still haven't tried it)

salam 2026-02-03T16:26:12.924789Z

there are a few workarounds but this would be the right solution: https://github.com/cursive-ide/cursive/issues/1403. please vote.

serioga 2026-02-03T20:25:11.036569Z

@evg.tso I use 'Actions on save'. It works pretty fine.