Fork me on GitHub

Hallo Michiel. Do we have somewhere a linter idea for the (:refer-clojure :exclude [something]) if there is no something in the namespace and :exclude is redundant?


no, but I think that is a good idea, maybe :unused-refer-exclude or so


It is very good idea, otherwise I have redundant excludes after refactoring 🙂


Should I file a ticket?


yes, please 🙏


maybe :redundant-refer-exclude is a better name indeed, since you don't really "use" them

Giorgio Valoti12:01:52

👋 Hello folks. I’m trying to confirm this behaviour with clj-kondo. This should be a reproducible example:

(defn- my-private-fn [])

  (defmacro my-with-redefs
    [bindings & body]
    `(clojure.core/with-redefs ~bindings (f#)

  #_{:clj-kondo/ignore [:private-call]}
  (my-with-redefs [my-private-fn (constantly :ok)]
                  (+ 1 2))
In other words, I would like clj-kondo to ignore the usage of my-private-fn but it doesn’t, presumably because of macro machinery?


I don't see the error in this specific example, but I do when I refer to the private var from another ns. Is that what you mean?


(ns foo)
(defn- my-private-fn [])

(defmacro my-with-redefs
  [bindings & body]
  `(clojure.core/with-redefs ~bindings (f#)

(ns bar (:require foo))

#_{:clj-kondo/ignore [:private-call]}
(foo/my-with-redefs [foo/my-private-fn (constantly :ok)]
                (+ 1 2))


I don't know why the error isn't gone with the annotation, I think that's a bug. Please file an issue. But you can ignore the warning by writing:

(foo/my-with-redefs [#'foo/my-private-fn (constantly :ok)]
                (+ 1 2))

Giorgio Valoti15:01:55

Yes, the fn was in another namespace

Giorgio Valoti15:01:17

Thanks @borkdude I’ll file an issue asap 🙂

Michaël Salihi13:01:26

Hello guys! I wonder to know what's the best solution to avoid shadowed var in a let destructuring form? Currently I destructuring a JS object which contains key that shadowed clojure.core/key:

(map #(j/let [^:js {:keys [x y height width color data key]} %

Michaël Salihi13:01:25

Of course, I can do something like:

(map #(j/let [^:js {:keys [x y height width color data] :as bar} %
              current-key (:key bar)


@admin055 You can avoid it with explicit named keys destructuring:

{my-other-key :key
:keys [x y z]


but your method of course works too

Michaël Salihi13:01:02

Perfect, I forgot the syntax, this is what I was trying to do. Thanks @borkdude!

👍 1

btw, Clojure Extras does not lint my code with built-in clj-kondo anymore. It was installed from the file firstly (and worked), then disabled (because too annoying), then enabled after installing from marketplace (and upgraded twice) — and it does not lint anymore. Removed then installed again — no changes. simple_smile


Hi, would you mind opening an issue here? It’d help if you can add the versions (intellij, cursive, extras) so that I can also test it here). Thanks 🙂


@serioga please report in #clj-extras-plugin

👍 1

and maybe tag @brcosta there

Karol Wójcik23:01:18

Got a very bizzare issue cc @borkdude. Here is a minimal reproduction. 1. Define file core.clj

(require '[malli.core])
(require '[malli.experimental])
(require '[potemkin :as pot])

(pot/import-vars [malli.core [form schema =>]
                  malli.experimental [defn]])
2. Run.
clj-kondo --lint core.clj
3. Result:
core.clj:6:1: warning: redefined var #'user/
linting took 7ms, errors: 0, warnings: 1
clj-kondo v2022.01.15


I will take a look


This works for me:

(ns foo (:refer-clojure :exclude [defn]))

(require '[malli.core])
(require '[malli.experimental])
(require '[potemkin :as pot])

(pot/import-vars [malli.core form schema =>]
                 [malli.experimental defn])


you shouldn't nest the imported vars in a separate vector I think


nonetheless, the error message could be better here, feel free to post an issue about this

Karol Wójcik11:01:17

Thank you for correcting me! My bad! 🙂