clj-kondo

https://github.com/clj-kondo/clj-kondo
2020-09-20T10:21:21.009500Z

@borkdude so i tried working on a hook for libpython-clj: https://gist.github.com/sogaiu/b6aa01efbd4006bbcab8decf2d5889aa in this case the construct is similar to a defn. is there something i can do to make the defined name show up in the analysis so i can use that toward indexing?

borkdude 2020-09-20T10:22:50.010400Z

if you expand to a defn that uses that name, I think it should also show up in the analysis? if it doesn't, it might be a bug or there's some reason I don't know off the top of my head

2020-09-20T10:23:44.011100Z

thanks

borkdude 2020-09-20T10:25:06.011700Z

could also be metadata related, forgetting to restore a position - not sure.

2020-09-20T10:26:53.012100Z

thanks for the tips

2020-09-20T10:28:17.012500Z

ah i see rum's example tries to maintain metadata and i have not done so

2020-09-20T11:23:56.013200Z

@borkdude using with-meta made a difference in whether row, col info had something numeric. thanks!

2020-09-20T14:03:25.014300Z

there was another piece to the puzzle. it turns out libpython-clj uses a construct similar to import-vars from potemkin (though it's not exactly the same), so i think if i write a hook for that, the indexing may work.

borkdude 2020-09-20T14:16:36.015900Z

@sogaiu clj-kondo also has support for import-vars so if you rewrite to that, may also work