Often, I have rich comment blocks that have blocks of vars that I redefine, to try things out (i.e., for different environments). Currently clj-kondo says this warning: redefined var
Is there a way to ignore that for an entire function block?
I wonder if #_:clj-kondo/ignore
would work
yes
yes it does 🙂
#_:clj-kondo/ignore
(comment
...
...
...
lots of redefining going on here...
...
...
,)
oh, not quite...
actually sorry, wrong it does 🙂
@dharrigan This seems to work for me:
(def x)
(def y)
#_:clj-kondo/ignore
(comment
(def x)
(def y)
(def y)
)
it works
I was confused about something that it rightly pointed out, but was at the top of the file
yes, it works grand 🙂
@dharrigan More selectively:
(def x)
(def y)
#_{:clj-kondo/ignore[:redefined-var]}
(comment
(def x)
(def y)
(def y)
)
Excellent, this will make my live coding broadcasts have fewer warnings, thank you 🙂 Its now an Emacs snippet
:thumbsup:
Ah, it works now I upgraded clj-kondo (I was a release behind, inconceivable) Thanks for this excellent project.
thanks!
yes, works totally 100% fine 🙂
party times! 🙂
🎉
it found dead code 🙂
"I can see dead code"
I had a def
and a defn
of the same name
Of course, I could have just used :skip-comments true
in my configuration 🙂