clj-kondo

https://github.com/clj-kondo/clj-kondo
Yehonathan Sharvit 2021-04-07T06:46:00.214400Z

Sometimes, I need to require a namespace for its side-effects (e.g. defmethod declarations). clj-kondo seems to understand that when I write

(ns foo
  (:require bar))
But cider-refactor removes bar from the require list, as it “Remove any unused libspec vectors”. Does anyone know a way to tell clj-refactor to keep bar?

borkdude 2021-04-07T07:40:09.216100Z

Don’t know, maybe ask in CIDER? Perhaps it can use the same convention as clj-kondo?

Yehonathan Sharvit 2021-04-07T07:42:19.216400Z

How did you solve it in clj-kondo?

borkdude 2021-04-07T07:43:31.217500Z

Libraries without an alias or :refer are considered to be required for side effects and left alone

seancorfield 2021-04-07T15:08:40.218600Z

Is there any difference — to the tooling — between (:require bar) and (:require [bar])? I think some tools treat the latter as a special case but not the former?

borkdude 2021-04-07T15:17:49.218800Z

to clj-kondo there is no difference I believe