clj-kondo 2026-07-15

$ clj -M:clj-kondo/dev --lint - <<< '(defn foo [x] (if (string? x) (inc x) (subs x 1)))'
:1:36: warning: Expected: number, received: string.
linting took 39ms, errors: 0, warnings: 1

🆒 2
1

the (if (string? x) ...) uncovers more of those redundant str calls ;)

Not in our code, it didn't. But one thing that impressed me mightily: We have a utility fn, make-customer-id, that just calls format on its arguments. No type hints. Lower down the code, there's a let with fk (make-customer-id site-id member-id) and below that we had (str fk)... Kondo figured out that the result of make-customer-id would only be a string, so fk was a string, so the str call was redundant. Impressive!

🎉 1

Ah nice, found a real issue:

Since we can assume string-or-glob is a string here, the str call is redundant

@seancorfield just merged this, wonder if you will find anything (or in case of false positives, let me know of course!)

Thanks. In an hour or two, LSP should pick that up and produce a new nightly, then I'll restart VS Code to pick that up and test it.

Didn't find any Expected: type mismatch warnings in with the new version on our code at work.

We have a lot more Single argument to str already is a string than I realized 🙂

(we had a lot of code before we added clj-kondo!)