I have a question about usage of clojure.pprint vars in public code. i know clj-kondo can do usage analysis, is that documented somewhere?
Yes, check analysis/Readme.md
excellent, thank you
burned myself the other day with a stupid mistake, was thinking maybe it could be a linter
given repro.clj:
(ns repro)
(defn x [& _]
"y")
(println x "z")
run:
$ clj -M repro.clj
repro$x@11963225 z
usually (always?) I'm trying to call a function to get a value in a string, and not get the string of the function definition. but it might depend on the project
worth opening a feature request issue for this?yes, I was talking about functions that do explicitly want a string, like str/includes?, println isn't such a function
I'm not sure how this would work in general. It's not always immediately clear that passing a function as value rather than calling it is mistake, unless the function you're passing it to explicitly wants a string
yeah I was thinking, anything that explicitly wants a string
or more generally: a function being passed to anything known to be not callable seems more like a type check than a linter idk how feasible it'd be to check if a function reference is used anywhere a string/number/etc. type is expected
this should already be caught by the linter as a type mismatch. e.g try passing a function to e.g (str/includes? f ...)
The println docs point at print, and print explicitly says it prints objects, not strings
println is not a function that explicitly wants a string