Fork me on GitHub
#clj-kondo
<
2023-03-24
>
rafaeldelboni16:03:55

Hey I was using clj-kondo analysis :filename to try to get the source file in github, but for clojurescript I'm having a "problem" For this two examples the filename only shows: • cljs/analyzer/api.cljscljs/analyzer/passes.cljs But the folder structure before the cljs folder is different: • https://github.com/clojure/clojurescript/blob/r1.11.60/src/main/clojure/cljs/analyzer/api.cljchttps://github.com/clojure/clojurescript/blob/r1.11.60/src/main/cljs/cljs/analyzer/passes.cljc Is there a way to get a bigger path in :filename or infer this difference in any way?

borkdude16:03:38

I think this comes from a jar file. You can get a longer name by setting :canonical-file-names true (or so, see docs)

rafaeldelboni16:03:49

You mean :canonical-paths ?

rafaeldelboni16:03:05

cool I will give it a try

rafaeldelboni16:03:34

nah, it appends the source of the information like: "/Users/rafael.delboni/.m2/repository/org/clojure/clojurescript/1.11.60/clojurescript-1.11.60.jar:cljs/analyzer/api.cljc"

rafaeldelboni16:03:26

but that's fine, I'm using this tool in a non intended way I think hahaha

borkdude16:03:50

I don't understand what else you are missing, what more is there to know about the location where it came from

rafaeldelboni16:03:46

I'm building a web app with the analysis data extracted from kondo, one feature I was adding was a link to the source in the github of the analysis

borkdude16:03:09

Take a look at quickdoc, it builds documentation with source links to github: https://github.com/borkdude/quickdoc/blob/main/API.md But you need to provide the github repo yourself as this is not part of the analyzed data

borkdude16:03:29

> I'm building a web app with the analysis data extracted from kondo Very cool ❤️

rafaeldelboni16:03:29

It's just a study of mine over spa https://rafael.delboni.cc/clojuredocs-helix/#/org.clojure It works for clojure, but not for clojurescript

borkdude16:03:46

if you want to have more accurate locations, it's better to git clone clojurescript and then analyze the source folders from clojurescript's repo

borkdude16:03:56

and then derive the github links from the filenames

rafaeldelboni16:03:50

cool, I will probably pivot to this instead downloading the jars 🙂, similar to quickdoc thanks