clj-kondo

https://github.com/clj-kondo/clj-kondo
2020-09-21T05:29:16.017700Z

@borkdude thanks -- it's slightly different in form i think, but i adapted @lee's example to end up with this: https://gist.github.com/sogaiu/ad05cde3fd2529c11949903ca5993301 i transplanted the metadata so more info is available in the analysis: https://gist.github.com/sogaiu/ad05cde3fd2529c11949903ca5993301#file-utils-clj-L67-L72 @lee don't know if it's worth it for import-vars-with-mods, but it seems something similar could be done there.

2020-09-21T05:32:21.020200Z

a downside of export-symbols and import-vars is that the indexed info points you at a location that doesn't make it convenient to get to the ultimate definition you'd likely be interested in seeing. contrast this with what core.async does: https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L56-L60 a tool might send you to those defns from usages but it's only one more step to use the tool again to get to the defintion that's being wrapped.

borkdude 2020-09-21T10:00:25.021300Z

@sogaiu I tend to go with the core.async approach and avoid tools like import-vars. I do support it in clj-kondo since it's pretty well established in the community

👍 1
lread 2020-09-21T12:14:42.028900Z

Thanks @sogaiu, I will take a look. The import-vars approach most certainly has its pros and cons. Continueing with it in rewrite-cljc has taught me tons, which has been fun for me, but the amount of time I have spent on it has been, uh, lots.

😆 1
lread 2020-09-21T12:21:21.031700Z

@borkdude, I do like sci’s copy-var, which is different but reminds me of import-var. https://github.com/borkdude/sci/blob/187c4551227c938090910b8ab3da024ca674c2ac/src/sci/core.cljc#L47