Hello I'm developing a inspector/plugin tool Does kondo has a function like this:
(kondo/resolve {:sym 'clojure.core/+
:classpath "...."})
=> [{:file "clojure/core.clj"
:line 123
:jar "org/clojure/clojure.jar"
....}]
@souenzzo You could maybe utilize the analysis output for this:
clj-kondo --lint - --config '{:output {:analysis true :format :edn}}' <<< '(defn foo []) (foo)'
{:analysis {:var-definitions [{:filename "<stdin>", :row 1, :col 1, :ns user, :name foo, :fixed-arities #{0}}], :var-usages [{:name defn, :filename "<stdin>", :from user, :macro true, :col 2, :arity 2, :varargs-min-arity 2, :row 1, :to clojure.core} {:filename "<stdin>", :row 1, :col 16, :from user, :to user, :name foo, :fixed-arities #{0}, :arity 0}]}}
In the above example it outputs the definition of user/foo in the file <stdin> and the usage of user/foo also in the file <stdin>
Other work in this area is https://github.com/didibus/anakondo
Most of kondo output is just about current project. I need also info about dependencies
Then you'll need to lint also the dependencies
Wow I can
(kondo/run!
{:lint (string/split "....my giant classpath...."
#":")})
Nice. ThanksYou don't have to split the classpath, clj-kondo understands classpaths
so just {:lint [the-classpath]}
if you use this option: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#output-canonical-file-paths
clj-kondo will also output the .jar file under :filename