Fork me on GitHub
#clj-kondo
<
2020-06-06
>
martinklepsch07:06:46

I’m having some config to ignore an unresolved symbol in one particular namespace. My editor integration picks it up correctly but when ran with --config on the CLI it seems the namespace specific configuration is ignored. Is this intentional?

martinklepsch07:06:42

{:clj-kondo/config {:linters
                      {:unresolved-symbol
                       {:exclude [sentry]}}}}
This is the piece of config. Interestingly my editor integration does NOT pick this up correctly with quotes. ie. '[sentry]

borkdude07:06:55

Try quoting the entire config: '{:linters ...}

borkdude07:06:58

The config should never contain inner quotes.

borkdude09:06:34

@U050TNB9F So this works:

(ns foo
  {:clj-kondo/config '{:linters
                       {:unresolved-symbol
                        {:exclude [sentry]}}}})

(map sentry [1 2 3])

4
martinklepsch19:06:34

That did the trick. Seems a little surprising to me though? Why does the quoting only work in this one place?

borkdude19:06:12

@U050TNB9F Because clj-kondo doesn't evaluate code

borkdude19:06:56

the quotes are just there to please the clojure who is running the code

borkdude19:06:04

clj-kondo just reads it as a plain EDN sexprs

borkdude19:06:15

but for compatibility it supports the outer quote

Adrian Smith21:06:58

Playing around with the type stuff foo2 gives a warning, foo1 does not, does this warrant an issue?

borkdude21:06:23

@sfyire This does work: (defn foo1 [^long s]) (foo1 "get"). But adding Integer to map to :int would be good I think

borkdude21:06:28

So issue welcome