This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-09
Channels
- # aleph (1)
- # announcements (7)
- # asami (1)
- # beginners (44)
- # calva (54)
- # cherry (24)
- # cider (6)
- # clj-kondo (19)
- # cljsrn (27)
- # clojure (119)
- # clojure-europe (61)
- # clojure-gamedev (38)
- # clojure-germany (7)
- # clojure-nl (1)
- # clojure-norway (104)
- # clojure-portugal (4)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (38)
- # cursive (18)
- # datomic (11)
- # emacs (9)
- # events (1)
- # fulcro (4)
- # holy-lambda (7)
- # introduce-yourself (7)
- # jobs (1)
- # malli (6)
- # off-topic (4)
- # pathom (4)
- # pedestal (16)
- # podcasts-discuss (1)
- # polylith (27)
- # portal (17)
- # releases (2)
- # shadow-cljs (46)
- # squint (1)
- # xtdb (9)
@borkdude btw, re your https://twitter.com/borkdude/status/1589951843991683073 on :refer :all, that's actually a warning, not an error, in Clojure 1.12.0-alpha1 due to the changes in var interning
this is actually similar to the issue we saw with adding clojure.core/abs in 1.11 (but that's a little more special because clojure.core is auto-referred)
@alexmiller Awesome!
How do I disable all linting for a file from within the file? This doesn't work:
(ns foo
{:clj-kondo/config ^:replace {:linters {}}})
Can it be done? 😃@borkdude On a related topic, can ns metadata provide :lint-as
config for macros in that ns? I've not been able to get that to work...
yes, that should work but you have to use the quote on the config
{:clj-kondo/config '{:lint-as {foo.bar/baz ...}}}
in fact I used it yesterday for this example: https://gist.github.com/borkdude/1fc2bd73c77d094fb0577c9caf9684b3
And that foo.bar/baz
is how to refer to a macro baz
in the same file, i.e., where the ns is (ns foo.bar ..)
?
I found the non-working example and futzed with it a bit and it starting working. Two things seemed to be working against me:
• I had #:clj-kondo{:config ..}
• I had :lint-as '{...}
Once I changed the format to {:clj-kondo/config '{:lint-as {..}}}
it worked -- i.e., switched away from the namespaced-map format and moved the quote out to the whole :clj-kondo/config
value instead of just the :lint-as
value.
great, yes, this is the expected format. The reason it works like this is that clj-kondo sees this as a rewrite-clj node, not as plain EDN
and writing quotes in unexpected places gets you EDN like this: {(quote foo) bar}
etc which is hard to parse
Ah, I didn't realize it was so sensitive to structure -- I'd assumed Clojure-equivalence in syntax.
Right, but I thought that was reader-equivalent.
I can see now that it is subtly different 🙂
It's documented here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#metadata-config (I don't mean that as RTFM, just FYI ;))
Well, if I'd read that caveat, I would have known! :rolling_on_the_floor_laughing: Thank you!