Fork me on GitHub
#clj-kondo
<
2023-06-15
>
kolstae10:06:15

I've been getting clj-kondo warnings on manifold functions since 0.4.0, when using version 0.3.0 the problem disapears. Has anyone else come across this problem?

src/trank/execute.clj:43:4: warning: Unresolved var: d/error-deferred
src/trank/execute.clj:64:6: warning: Unresolved var: d/future
src/trank/execute.clj:107:30: warning: Unresolved var: d/catch
src/trank/execute.clj:140:10: warning: Unresolved var: d/success-deferred

borkdude10:06:41

could be related to the bundled config?

Matthew Davidson (kingmob)10:06:13

@U04V15CAJ IIUC, library users have to import the distributed config, right? And only the ones exposed via /resources/ are importable by users. (Stuff I define under /.clj-kondo is only for me by default, right?) If so, I'm not sure how the bundled config is the issue, since the current one is https://github.com/clj-commons/manifold/blob/master/resources/clj-kondo.exports/manifold/manifold/config.edn, and doesn't involve those vars.

borkdude10:06:41

ok makes sense. I don't know why d/error-deferred is unresolved since it's just defined using normal defn right

Matthew Davidson (kingmob)10:06:08

I mean, don't get me wrong, Zach's old code is macro-heavy, and very kondo-unfriendly. It even temporarily switches namespaces in the middle of one file. So kondo errors don't surprise me; I see them all the time. But if that were the case, I'd expect the problem to appear in 0.3.0 as well.

borkdude10:06:53

@U55V0HZMJ you can just add to your config: {:linters {:unresolved-var {:exclude [the-offending.ns]}}}

kolstae10:06:31

Thank you both!

Matthew Davidson (kingmob)10:06:10

The biggest change in 0.4.0 is the CompletableFuture support, but that should be purely additive. @U55V0HZMJ if you're willing to do a bisect with SHAs for intermediate commits, that would be pretty helpful

Matthew Davidson (kingmob)10:06:24

@U55V0HZMJ Alternatively...what editor/IDE are you using?

Matthew Davidson (kingmob)10:06:45

To be clear, if checking in the IDE, it might be good to double-check from the command-line. At least in Cursive, I sometimes see Cursive errors, and think they're kondo errors, or vice versa

kolstae10:06:59

I'm using IntelliJ with Cursive, but I use the command-line for this reporting (I have a git-commit hook)

borkdude10:06:29

to see those errors on the command line, be sure to lint the manifold dependency first, else you might not see the error

kolstae10:06:11

I do the following:

clj-kondo --lint "$(clojure -Spath)" --dependencies --parallel --copy-configs
clj-kondo --lint src test

👍 2
Matthew Davidson (kingmob)10:06:21

@U55V0HZMJ Is there more code you could share?

kolstae10:06:03

Let me try to make a minimal example and see. I'm not sure what code to share really, it just a require with alias :thinking_face:

Matthew Davidson (kingmob)10:06:33

Does sound unlikely, but it might not hurt to get more eyes on the ns

Matthew Davidson (kingmob)11:06:30

Just checked the git history, and for error-deferred, it hasn't changed since 0.1.7-alpha1, so it's gotta be something else triggering it.

borkdude11:06:09

sorry to have tagged you @U10EC98F5, should have checked myself first

Matthew Davidson (kingmob)11:06:33

Unfortunately, manifold is just not very linter-friendly.

kolstae11:06:49

Again thanks for your time and effort! It's not constantly reproducible for some reason 😕

Matthew Davidson (kingmob)11:06:28

Heh. Well, if that changes, let us know