Hello!
I’m working on adding the new clj-kondo hooks into a legacy codebase
But I get mysterious warning: unused binding this lint problems on some (but not all!) of my defrules
What might be cause of this?
@matt.ielusic I've indeed recently added support for linting clara-rules through clj-kondo hooks, I noticed the same thing this week with some of my own codebase and will be working on a fix for the linter. The initial goal was to add linter support which previously did not exist, it will improve over time.
this version contains the fix: https://clojars.org/com.cerner/clara-rules/versions/0.22.1
Seems related to recent work. https://github.com/cerner/clara-rules/pull/482
That’s the PR that added the new hooks, right? I don’t understand the lint warnings they’re generating on my pre-existing codebase.
Oh. I misread I think. You are using the new hooks but getting warnings ? Maybe worth asking on the PR or associated issue to see if something is missing.
My rules don’t use this as a variable or fact name or anything, so I suspect the binding is being introduced https://github.com/cerner/clara-rules/blob/9610ee192ac608a2f9db9aa8ce5e2c65eb5ee35c/clj-kondo/clj-kondo.exports/clara/rules/hooks/clara_rules.clj#L65 or https://github.com/cerner/clara-rules/blob/9610ee192ac608a2f9db9aa8ce5e2c65eb5ee35c/clj-kondo/clj-kondo.exports/clara/rules/hooks/clara_rules.clj#L82
Yeah, that solved all my lint warnings, thanks!