Fork me on GitHub
#joker
<
2019-05-27
>
borkdude19:05:02

hi. small question that came up at clj-kondo and I wonder how joker thinks about it: if you write 'foo/bar or

`foo/bar
or
(quote foo/bar)
how should that affect linting ununsed namespaces? In Clojure, you do not need to require namespace foo in either case, although joker counts foo as used in the case of the syntax-quote

dominicm20:05:03

In the case of protocol metadata, there is something you're implementing though. And maybe you are expecting something else to use it.

borkdude20:05:45

@dominicm were you responding to my question? can you give an example - what do you think the behavior should be?

dominicm20:05:56

I was, yeah 🙂 Don't have a strong opinion, just weighing in that:

(with-meta obj {`foo/bar (fn [this] …)})
foo/bar is used, but it isn't directly called by my library (necessarily).

dominicm20:05:24

oh, I guess this is about unused-require vs unused-ns? Is there an unused-ns?

borkdude20:05:54

unused-require I mean yes

borkdude21:05:49

maybe syntax-quote is a good to choice to count the namespace as used, e.g. in writing macros, you’ll often want to load the namespaces, even if you’re only generating code that will use those namespaces and you’re not using them at macro definition time

đź‘Ť 4
borkdude21:05:19

so from that angle, joker’s behavior makes total sense

dominicm21:05:30

The ' makes no sense though, the require has nothing to do with that