clj-kondo

https://github.com/clj-kondo/clj-kondo
martinklepsch 2020-06-06T07:14:46.358900Z

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?

martinklepsch 2020-06-07T19:30:34.362100Z

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

borkdude 2020-06-07T19:55:12.362300Z

@martinklepsch Because clj-kondo doesn't evaluate code

borkdude 2020-06-07T19:55:56.362500Z

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

borkdude 2020-06-07T19:56:04.362700Z

clj-kondo just reads it as a plain EDN sexprs

borkdude 2020-06-07T19:56:15.362900Z

but for compatibility it supports the outer quote

martinklepsch 2020-06-06T07:15:42.359Z

{: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]

borkdude 2020-06-06T07:35:55.359200Z

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

borkdude 2020-06-06T07:44:58.359400Z

The config should never contain inner quotes.

borkdude 2020-06-06T09:02:34.359700Z

@martinklepsch So this works:

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

(map sentry [1 2 3])

✅ 1
Adrian Smith 2020-06-06T21:49:58.360200Z

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

borkdude 2020-06-06T21:53:23.361Z

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

borkdude 2020-06-06T21:53:28.361300Z

So issue welcome

Adrian Smith 2020-06-06T22:07:50.361400Z

cool placed it here: https://github.com/borkdude/clj-kondo/issues/910

borkdude 2020-06-06T22:09:46.361700Z

thanks