Fork me on GitHub
#clj-kondo
<
2022-11-09
>
Alex Miller (Clojure team)15:11:59

@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

👍 1
Alex Miller (Clojure team)15:11:05

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)

pez22:11:01

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? 😃

borkdude22:11:27

This can't currently be done from within a file

🙏 1
seancorfield23:11:16

@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...

borkdude23:11:20

yes, that should work but you have to use the quote on the config

{:clj-kondo/config '{:lint-as {foo.bar/baz ...}}}

seancorfield00:11:38

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 ..)?

borkdude08:11:25

Can you give a full example, just to make sure we’re taking about the same thing?

seancorfield17:11:38

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.

borkdude17:11:23

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

borkdude17:11:53

and writing quotes in unexpected places gets you EDN like this: {(quote foo) bar} etc which is hard to parse

seancorfield17:11:28

Ah, I didn't realize it was so sensitive to structure -- I'd assumed Clojure-equivalence in syntax.

borkdude17:11:46

it's not evaluated

seancorfield17:11:02

Right, but I thought that was reader-equivalent.

seancorfield17:11:33

I can see now that it is subtly different 🙂

seancorfield17:11:35

Well, if I'd read that caveat, I would have known! :rolling_on_the_floor_laughing: Thank you!