Fork me on GitHub
#clj-kondo
<
2020-03-19
>
Mitch15:03:50

I noticed after a discussion elsewhere today that kondo will lint if but does not seem to lint if-not. I think the linting rules would be the same, so this should be an easy change. I can submit a pull request this weekend if we want this

Mitch15:03:10

should have checked there. I can try my hand at it. Is there a name you like for #{if if-let if-not ...}? branching-conditionals?

borkdude15:03:46

there is a giant case expression in analyzer.clj. it has one case like this:

if (analyze-if ctx expr)
if that's changed to (if if-not) then I think it works for if-not as well

borkdude15:03:45

the other one is:

(if-let if-some when-let when-some when-first)
                  (analyze-conditional-let ctx resolved-as-clojure-var-name expr)
but analyze-conditional-let doesn't check for missing else branches. it can be easily added.

Mitch15:03:21

Nice, that is where I was looking. I'll be able to spend a little time on it on Saturday. Thanks for the awesome tool