This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-28
Channels
- # babashka (10)
- # beginners (140)
- # cider (6)
- # clj-kondo (10)
- # cljs-dev (39)
- # cljsrn (6)
- # clojars (1)
- # clojure (23)
- # clojure-europe (2)
- # clojure-spec (7)
- # clojure-uk (6)
- # clojurescript (1)
- # conjure (16)
- # cursive (3)
- # datomic (3)
- # emacs (6)
- # fulcro (13)
- # graalvm (3)
- # malli (8)
- # meander (4)
- # off-topic (43)
- # pathom (1)
- # pedestal (15)
- # re-frame (13)
- # reagent (3)
- # sci (25)
- # shadow-cljs (26)
- # sql (9)
- # testing (34)
- # tools-deps (80)
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}]}}
Most of kondo output is just about current project. I need also info about dependencies
Wow I can
(kondo/run!
{:lint (string/split "....my giant classpath...."
#":")})
Nice. Thanksif 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
👍 3
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