Fork me on GitHub
#clj-kondo
<
2022-05-20
>
zakkor07:05:02

clj-kondo is giving me false positive warnings for unresolved vars in the superstring library - any idea how to fix?

zakkor07:05:35

Something is definitely funky because I can see the function signature and documentation on hover but it's still shown as unresolved

borkdude08:05:40

What does the function definition look like?

zakkor08:05:35

(defmacro ^:private alias-ns
  "Create an alias for all public vars in ns in this ns."
  [namespace]
  `(do ~@(map
          (fn [^clojure.lang.Var n] `(defalias ~(.sym n) ~(symbol (str (.ns n)) (str (.sym n)))))
          (vals (ns-publics namespace)))))

(alias-ns clojure.string)

zakkor08:05:55

so... that's probably why 😄

borkdude08:05:51

You can exclude that namespace in the unresolved var linter perhaps

zakkor08:05:01

Thank you! That worked. For anyone else reading, I added:

:linters {:unresolved-var {:exclude [superstring.core]}}
to .clj-kondo/config.edn

borkdude08:05:40

There is a small library which can create stubs: https://github.com/clj-easy/stub And when you the lint that stub, you would get the right stuff

borkdude08:05:54

But this is slightly more work than just excluding it

genRaiy13:05:25

we all know that (myClass.) and (new myClass) are equivalent but did you know that full stops are becoming problematic?

genRaiy13:05:35

could you make a clj-kondo warning against the use of (myClass.) form to protect Clojure users from such rudeness?

genRaiy13:05:29

This is a Friday afternoon bit of fun. Please don't do it 🙂

lread13:05:36

There was a period in my life I found offensive

😆 1
lread13:05:51

And I think this linter should only be run periodically

1
borkdude13:05:22

Did I use full stop correctly?

lread13:05:25

Oooo... all caps... 😬

genRaiy13:05:27

never stop.

genRaiy13:05:44

❄️ 🚨

Joshua Suskalo14:05:06

Excuse me, the computer is my underling. I will use the exact amount of passive aggression that I want.

🙀 1
🪄 2
Joshua Suskalo14:05:14

I'll have to disable this lint.

borkdude15:05:11

#_:clj-kondo/ignore.