For those interested: I created an RPM for clj-kondo. AppImage and .deb builds may follow. https://build.opensuse.org/package/show/home:zilti:clojure/clj-kondo
@zilti Amazing. Feel free to add to the install instructions in the clj-kondo repo
looks like I cannot do #?(:clj #_{:clj-kondo/ignore [:unused-binding]})
🙂
there's an issue for that, will fix
oh with reader conditional. can you please give the full example. it might be a different issue
omg, I just spent an hour understanding why (name my-keyword)
didn’t work while (clj->js my-keyword)
did… classic case of shadowed variable. Can’t wait for kondo support for this 😄 “Name is forever nom.”
@borkdude full example is simple: I want to ignore bindings for :clj but not for :cljs. So I did not find solution for this. But I can create ticket.
@serioga this works:
(ns foo-ns
{:clj-kondo/config '{:linters {:unused-binding {:level #?(:clj :off :cljs :warning)}}}})
(defn foo [x]
#?(:cljs x))
but I need to disable for the form only, not whole namespace.
then use an underscore for the branch you want to ignore
“then use an underscore for the branch you want to ignore” I did not understand, what do you mean
#_{:clj-kondo/ignore [:unused-binding]}
(defn- select-field
[state column options idx remove-value classes]
...)
(defn foo [#?(:cljs x
:clj _x)]
#?(:cljs x))
this is too hardcore 🙂
or simply:
(defn foo [x]
x ;; ignore for clj
#?(:cljs x))
what you would like is:
#_{:clj-kondo/ignore #?(:clj [:unused-binding] :cljs []}
right?this isn't supported yet, but I'll see what I can do for next release
well, I aware about workarounds. I thought to use new “Ignore warnings in an expression” feature as less obtrusive but found that I want it to be selective for file type 🙂
can you confirm the above is what you want?
yes, I've tryed, it compiles and does not work :-)
yes, this is fine.
ok, the problem is that reader comments are processed before reader conditionals, but I'll see if that can be fixed
Maybe you will find place for the specification of the effective file type in the :clj-kondo/ignore data itself 🙂
I think using reader conditionals for this is more elegant
interesting, clj-kondo does not parse valid (or)
Can't parse dev\user.clj, Wrong number of args (0) passed to: clj-kondo.impl.types.utils/union-type
feel free to post an issue