clj-kondo 2026-10-23

Is this a false positive Condition always true clj-kondo(constant-condition) or do I just need more coffee and brains?

(cond-> resp
        (comp map? :body) (update :body
                                  (partial transform-keys
                                           (comp keyword name)))
edit: that points to the comp -clause

✅ 1

(comp map? :body) this value is always truthy (a function)

Yes, but isn't the whole point of cond-> that it tests the form, ie the composed fn and the return value may not be truthy?

cond-> only threads the expressions, not the tests

Ah 😅 picard-facepalm

Ah, hmm. indeed, the above does not do what I expected, it actually returns the resp with a nil :body when it is missing... Once again, clj-kondo was absolutely right 😎

Shame on me for suspecting it!