I've got a case where I'm deliberately discarding a value and clj-kondo is helpfully (and understandably) reporting warning: Unused value. When I add a hint #_{:clj-kondo/ignore [:unused-value]}, I then get info: Redundant ignore. What might I be misunderstanding? Concrete example:
% cat src/com/grzm/ex/claypoole_lint.clj
(ns com.grzm.ex.claypoole-lint
(:require [com.climate.claypoole :as cp]))
(defn -main [& _args]
(cp/upfor (cp/threadpool 5) [_ (range 5)]
(fn [] println))
:do-other-work)
% cat src/com/grzm/ex/claypoole_lint.clj
(ns com.grzm.ex.claypoole-lint
(:require [com.climate.claypoole :as cp]))
(defn -main [& _args]
(cp/upfor (cp/threadpool 5) [_ (range 5)]
(fn [] println))
:do-other-work)
% clj-kondo --version
clj-kondo v2024.11.14After adding hint:
% cat src/com/grzm/ex/claypoole_lint.clj
(ns com.grzm.ex.claypoole-lint
(:require [com.climate.claypoole :as cp]))
(defn -main [& _args]
#_{:clj-kondo/ignore [:unused-value]}
(cp/upfor (cp/threadpool 5) [_ (range 5)]
(fn [] println))
:do-other-work)
% clj-kondo --lint src
src/com/grzm/ex/claypoole_lint.clj:5:5: info: Redundant ignore
linting took 55ms, errors: 0, warnings: 0It's likely that you're hitting an issue that was fixed here: https://github.com/clj-kondo/clj-kondo/commit/268a9734c65b184da79fe8df705d21d0482bd210 can you perhaps try linting with the JVM version and a git sha?
Meaning build clj-kondo from git? Or something else?
Sorry, a bit slow. I see what you're saying.
yeah just with clj -Sdeps ... -M -m clj-kondo.main and then with the normal CLI args
% cat src/com/grzm/ex/claypoole_lint.clj
(ns com.grzm.ex.claypoole-lint
(:require [com.climate.claypoole :as cp]))
(defn -main [& _args]
#_{:clj-kondo/ignore [:unused-value]}
(cp/upfor (cp/threadpool 5) [_ (range 5)]
(fn [] println))
:do-other-work)
% rm -r .clj-kondo/.cache
% clj -Sdeps '{:deps {clj-kondo/clj-kondo {:git/url "" :git/sha "32447447cc6b26c3b7e40dac8135174e6a88253d"}}}' -M -m clj-kondo.main --lint src
src/com/grzm/ex/claypoole_lint.clj:5:5: info: Redundant ignore
linting took 85ms, errors: 0, warnings: 0
Same thing. Am I doing that right?yeah seems right, it's a pity that it didn't solve your problem
(For completeness, I've also copied the current claypoole clj-kondo configs from claypoole master)
can you file an issue, preferably with repro?
I will. Thanks!
for now you could just disable the redundant-ignore linter
For those playing along at home: https://github.com/clj-kondo/clj-kondo/issues/2446
Thanks!