Fork me on GitHub
#clj-kondo
<
2020-01-04
>
lispyclouds10:01:43

If I use a fully qualified ns like ( stream) clj-kondo warns with Unresolved namespace . Are you missing a require? but its fine with (clojure.string/split ...). Is this problem?

borkdude10:01:57

You are always supposed to add a require even if it works, since you should not rely on a namespace already being loaded elsewhere

lispyclouds10:01:22

but arent namespaces like and clojure.string are loaded by default?

borkdude10:01:16

well clojure.string is, but you should not rely on it

borkdude10:01:58

e.g. if clojure.spec loads clojure.string, you're lucky, but if spec doesn't you're not. it's an implementation detail

lispyclouds10:01:58

i mean i can do a () in a plain REPL without requiring, it still means something else has loaded it?

borkdude10:01:34

yeah, maybe your REPL tooling or Clojure main has, but that doesn't mean it will still have been loaded in a compiled artifact for example

borkdude10:01:00

According to Alex Miller you should not rely on it. I take his word for it.

lispyclouds10:01:17

ah, good to know. thanks! 😄

lispyclouds10:01:10

shouldn't it warn for clojure.string too? just to be consistent? this diff is what bothered me in the first place

borkdude10:01:26

kondo you mean? doesn't it?

lispyclouds10:01:39

okay somethings up with my editor then :thinking_face:

borkdude10:01:13

try flycheck-verify-setup

borkdude10:01:37

can you past the full namespace?

lispyclouds10:01:20

ah now i see it

lispyclouds10:01:39

long back there is a require picard-facepalm

lispyclouds10:01:02

thanks anyways 🙂