Fork me on GitHub
#clj-kondo
<
2024-05-06
>
adamfrey17:05:51

Can I entreat someone for a spot check on https://github.com/taoensso/encore/pull/76 I opened on taoensso/encore to add a clj-kondo hook for a macro in that library? This is my first time writing a kondo hook and I'd like to make sure I get it correct because encore is a transitive dependency pulled into a high number of clojure products across the community.

borkdude18:05:31

why use a hook for this if you can use :lint-as ?

adamfrey18:05:12

which macro should I lint as? Perhaps I didn't look closely enough.

(enc/defn-cached    )
I couldn't think of anything obvious in clojure.core that matched that form

borkdude18:05:52

I was just asking. Ok, if the syntax doesn't match defn then yes, this makes sense

adamfrey18:05:18

cool, thank you for taking a look!

borkdude18:05:32

and thank you for providing the hook! :)

👍 1
jacob.maine19:05:18

After upgrading manifold from 0.2.4 to 0.4.2, I’ve started getting unresolved-var diagnostics on some functions defined in the manifold.deferred ns, for example manifold.deferred/success-deferred. I thought maybe the function was deleted, but it https://github.com/clj-commons/manifold/blob/12950654f185c65156a5817f5bec79a3afbfe401/src/manifold/deferred.clj#L702 it’s still defined. Should I report this as a bug? If it’s helpful, I have a very minimal reproduction.

jacob.maine19:05:02

I can reproduce the problem with the following project:

;;; deps.edn
{:paths ["src"]
 :deps {manifold/manifold {:mvn/version "0.2.4"}}}

;;; src/example.clj
(ns example
  (:require [manifold.deferred :as d]))

(d/success-deferred nil)

jacob.maine19:05:00

That will have no lint. But if I upgrade manifold to 0.4.2 and run the following code, I’ll get an unresolved-var warning:

jacob.maine19:05:24

$ rm -rf .clj-kondo/.cache
$ clj-kondo --lint "$(clojure -Spath)"  --dependencies --parallel --copy-configs
$ clj-kondo --lint src
src/example.clj:4:2: warning: Unresolved var: d/success-deferred
linting took 5ms, errors: 0, warnings: 1

borkdude19:05:19

before posting an issue, perhaps you can find out if this is due to a change in manifold or in clj-kondo?

jacob.maine19:05:02

Any advice on how to do that? Maybe check out manifold and change my sample project’s deps.edn to use that local dep? Then delete their clj-kondo config, or git bisect through their history?

borkdude19:05:50

I don’t know exactly without trying to solve the issue myself

jacob.maine19:05:09

OK, I’ll keep debugging. Will post back here with what I find.