You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially the conclusion is to protect namespace declarations that are side-effecting from pruning (e.g. namespaces that load protocol extensions or multimethods etc) by not having them :refer anything or use an :as form.
clj-kondo and I believe some other tools already follow this convetion; it would be nice for refactor-nrepl to support this too.
I suspect it would be pretty simple to edit this function to support it?
We've discussed this already in this repo and I consider it a non-issue for Clojure code. As I said over here I solve this by doing:
(nsmy-ns
(:require [clojure.string :as str]))
;; This has some really sweet side-effects that we want, because reasons
(require 'tick.timezone)
This makes it super clear that this ns needs special consideration and requires no out-of-band knowledge about conventions.
Since people keep asking for this feature (and the solution above doesn't work for cljs) I agree with @bbatsov that a PR would be great, with the caveat that it has to be opt-in via a new setting. That way we don't create confusion for our existing user-base and leave the door open for the solution above that I find preferable when dealing with a Clojure-only project.
The convention came about in this clj-kondo thread:
clj-kondo/clj-kondo#241
Essentially the conclusion is to protect namespace declarations that are side-effecting from pruning (e.g. namespaces that load protocol extensions or multimethods etc) by not having them
:refer
anything or use an:as
form.clj-kondo and I believe some other tools already follow this convetion; it would be nice for
refactor-nrepl
to support this too.I suspect it would be pretty simple to edit this function to support it?
refactor-nrepl/src/refactor_nrepl/ns/prune_dependencies.clj
Lines 118 to 122 in dbafd6e
The text was updated successfully, but these errors were encountered: