Fork me on GitHub
#clj-kondo
<
2021-04-07
>
Yehonathan Sharvit06:04:00

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?

borkdude07:04:09

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

Yehonathan Sharvit07:04:19

How did you solve it in clj-kondo?

borkdude07:04:31

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

seancorfield15:04:40

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?

borkdude15:04:49

to clj-kondo there is no difference I believe