Fork me on GitHub
#clj-kondo
<
2019-12-06
>
celwell00:12:18

Secretary's defroute macro trigger's unresolved symbol ... . I assume this 'false positive' might come up with quite a few libraries that use a def* pattern, or any macro for that matter. Any ideas of what I can do, other than just trying to ignore it?

borkdude08:12:42

@celwell it seems this pattern is co-incidentally a lot like clojure.core/defn:

$ clj -A:clj-kondo --config '{:lint-as {secretary.core/defroute clojure.core/defn}}' --lint /tmp/foo.clj
linting took 210ms, errors: 0, warnings: 0
(require '[secretary.core :as sec])

(sec/defroute home-path "/" [x] x)

(home-path 1)

celwell18:12:02

Oooo... nice, I 'll use that, thanks!

plexus14:12:49

👋:skin-tone-2:

plexus14:12:09

is it possible to tell clj-kondo that for certain namespaces :refer :all is ok?

borkdude14:12:10

@plexus There is an open issue for this: https://github.com/borkdude/clj-kondo/issues/560 It's not yet implemented.

👍 4
plexus14:12:24

ok, thanks!

borkdude14:12:50

There is a proposal in the issue and it might not be too hard to implement, so if you're interested, go for it.

borkdude14:12:15

Otherwise, I bumped the priority of the issue in the board, so hopefully it shouldn't be too long

borkdude14:12:44

If you decide to work on it, please let me know, so I can set the issue in progress and assign a name to it

plexus14:12:54

I'll let you know, I have an open PR on rep that I should probably wrap up before opening up new ones 🙂

Nick McCurdy19:12:29

I’m getting unresolved symbol errors when using :refer :all (as generated by Leiningen’s test files). Is that expected or are they supposed to be hidden after this fix? I am on version 2019.11.23 <https://github.com/borkdude/clj-kondo/commit/7ee6199b93528701b2bfe5b7a8ddcbff96a0b956>

borkdude20:12:28

If you also lint the referred namespace and use a project cache, clj-kondo will be able to resolve those syms