Fork me on GitHub
#emacs
<
2019-11-27
>
bozhidar15:11:00

@lvbarbosa Well, it’s certainly doable as evidenced by the tools that exist. I think today you have 3 options - clj-kondo, clojure-lsp and clj-refactor. I like kondo, as it doesn’t require any extra setup from me, but I’ve heard good things about clojure-lsp and clj-refactor. Unused vars are not hard to implement in CIDER itself, I just never had the time for this.

borkdude15:11:01

Might be a nice experiment. bozhidar: do you think it's possible without any additional elisp? I looked at squiggly-clojure and it provides an elisp package

bozhidar09:11:36

We’ll also need a bit of Elisp for the UI, but that should be trivial. It’d be really great if we had something like squiggly-clojure for kondo, that’s using middleware instead of just evaluating code, so it would return data that’s optimized for the Elisp clients. That can expand the usefulness of kondo to more than linting - e.g. you can directly expose the data needing for find-usages, bake project integration, etc.

Lucas Barbosa16:11:00

Gotcha... I am scheduling some time for myself in the future to study Clojure tooling internals. I might be able to contribute afterward

didibus20:11:48

Couldn't we make clj-kondo in Emacs rely on projectile's notion of projects to perform linting? Or maybe make clj-kondo project.clj aware?

didibus20:11:27

How slow is it to have clj-kondo do full project linting? We talking unbearably slow? Or, won't really notice slow?

borkdude20:11:50

Depends on how large your classpath is. Clj-kondo lints some projects in CI: clojure itself, clojurescript itself + some libs, this takes about 10 seconds

didibus20:11:13

Hum.. does IntelliJ and co achieve better speed by being long lived process? As I understand, kondo would do a full lint all the time. But I think IntelliJ for example keeps a full AST of Java at all times and as things are changed, it partially update that AST and only perform analysis related to the changes.

borkdude21:11:08

yes, it's the difference between a server that can accumulate state and a binary which is invoked once and lives very shortly.

borkdude21:11:50

but if clj-kondo is invoked as a library in a cider middleware you could achieve the same effect probably

didibus23:11:16

Thanks for the info!!