This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-30
Channels
- # announcements (4)
- # babashka (3)
- # beginners (5)
- # calva (20)
- # cider (12)
- # clj-kondo (7)
- # cljs-dev (2)
- # clojure (76)
- # clojure-uk (4)
- # clojuredesign-podcast (8)
- # clojurescript (18)
- # clojutre (1)
- # cursive (9)
- # data-science (27)
- # datomic (2)
- # fulcro (32)
- # graalvm (4)
- # jackdaw (5)
- # jobs (2)
- # joker (5)
- # lumo (20)
- # off-topic (18)
- # pathom (3)
- # shadow-cljs (18)
- # sql (5)
- # tools-deps (1)
- # vim (11)
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!
@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
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
ok, that makes sense. that a script exists and i can use it is plenty good enough for me 👍
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
@robert-stuttaford Yes, you can use clj-kondo as a JVM library as well and do fun things with the output
thanks, this is rad 🙂