This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Will this bit of code get me all invocations of bar
in the function foo
?
(->> results
:analysis
:var-usages
(filter #(= 'bar (:name %)))
(filter #(= 'foo (:from-var %))))
Ignoring namespaces for now
Is analysis
not included when using clj-kondo as a pod on babashka?
you can see for example here where it is used in quickdoc: https://github.com/borkdude/quickdoc/blob/main/src/quickdoc/api.cljc it doesn't matter here if you use clj-kondo on the JVM or via the pod, same results
but you have to enable the analysis output: https://github.com/borkdude/quickdoc/blob/d9ac51475ea46e1caf9b059f2a72ddfeeec6111c/src/quickdoc/api.cljc#L58
Ah got it, I didn’t have it inside a :config
Thanks @U04V15CAJ.
Which I imagine would be a byproduct of a very useful step - checking for things provided by multiple sources/jars - a grievous pickle that I last noticed in connection with a GraphQL-related library that pulled in 2 ANTLR jars with nominally overlapping contents...
@U0HG4EHMH could you elaborate please?
In the sense that if you have sufficient information to declare that a Java class is ambiguous (and cite the libraries that contribute it) you also have sufficient information to cite the library that contributed any particular namespace
@U0HG4EHMH not totally sure I understand what you mean. Here's an example I'm dealing with:
ns | cljs.core
name | defn
repos | ['athos/reading-clojurescript', 'clojure/clojurescript']
so what we have here is cljs.core/defn
, which is defined in two libraries. There are obviously going to be a ton of usages for this, but I don't see a clear way to disambiguate which of the definitions a usage points at. Maybe looking at deps.edn/project.clj might help, but it's still not 100%.