This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-15
Channels
- # announcements (2)
- # beginners (13)
- # calva (17)
- # cider (21)
- # clerk (3)
- # clojure (42)
- # clojure-austin (1)
- # clojure-doc (8)
- # clojure-europe (82)
- # datahike (1)
- # deps-new (13)
- # emacs (5)
- # fulcro (3)
- # hyperfiddle (7)
- # missionary (1)
- # off-topic (16)
- # portal (6)
- # releases (1)
- # shadow-cljs (3)
- # tools-build (1)
- # vim (7)
- # xtdb (3)
So I played around a bit with the Rama and I copied over the code from the blog post about the Clojure API and I got it working (yeah), but I see errors just about everywhere:
is there a way to turn this off? or since it works make them go away in some other way? (I assume these things are defined in macro's etc)
I am not the only one with this problem: https://groups.google.com/u/0/g/rama-user/c/xtP87k-pmBE
You can silence the warnings by adding a bit in your namespace declaration:
(ns core {:clj-kondo/ignore true})
There's finer controls, but that's the catch-all. The rest are documented here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md
Is it just me, or does indentation not work properly in cljs files? Whenever I define a function, for example, with the arglist on a new line the default indent is this:
(defn foo
[]
instead of this (which is what it is in clj files):
(defn foo
[]
The same can be seen with s/def
and ns
Okay I opened another cljs project and it indents properly (the second way). So it looks like there’s some bad config somewhere in my first project.
Ah I see the issue: I had a .cljfmt.edn file in my project root, with the following (for context when-loaded
is a custom macro):
{:indents {when-loaded [[:inner 0]]}}
Aha: I should have put :extra-indents
instead of :indents
since the latter overwrites the pre-existing indent config for all forms, not just my custom macro.
So problem solved; hopefully this thread will be helpful for anyone else who needs custom formatting
This changed recently. You probably just missed the memo. 😃 I agree it’s good with another thread about it.
Ah I just saw the cljfmt changelog. Yes I indeed missed the memo (plus I haven’t opened that project in many months)
(For anyone else reading this is the breaking change: https://github.com/weavejester/cljfmt/blob/master/CHANGELOG.md#0110-2023-07-27)
I missed the memo at first too, and broke Calva formatting when upgrading to latest cljfmt. Here’s the changelog item for when I fixed it: https://github.com/BetterThanTomorrow/calva/blob/published/CHANGELOG.md#20385---2023-08-15 There’s also a note attached here: https://calva.io/formatting/#indentation-rules