Fork me on GitHub
#clj-kondo
<
2019-11-30
>
robert-stuttaford09:11:00

hey @borkdude! does / will clj-kondo report on unused vars at all, e.g. after linting the whole classpath? like unused private vars, but also non-private vars. this isn't useful for libraries, but it's very useful for apps!

borkdude09:11:02

@robert-stuttaford That requires seeing the entire project first and this is the reason why clj-kondo won't report it in the editor, since it could also result in false positives (have we seen all the things? do we know for sure? it's an open world...) But... you can use the analysis export and script it yourself: https://github.com/borkdude/clj-kondo/tree/master/analysis#unused-vars

borkdude09:11:33

Another reason it's not reported in the editor is performance: we would have to load the entire cache for every editor action, which is costly

robert-stuttaford09:11:00

ok, that makes sense. that a script exists and i can use it is plenty good enough for me 👍

borkdude09:11:32

There have been some thoughts about making a cider middleware that invokes clj-kondo on the classpath and then uses the analysis export to make squiggles, so an on-demand action. I'd like to see someone pick this up some time

borkdude09:11:22

@robert-stuttaford Yes, you can use clj-kondo as a JVM library as well and do fun things with the output

robert-stuttaford09:11:39

thanks, this is rad 🙂