This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-15
Channels
- # announcements (1)
- # babashka (1)
- # beginners (43)
- # cider (2)
- # clj-kondo (29)
- # clojure (61)
- # clojure-austin (18)
- # clojure-dev (7)
- # clojure-europe (30)
- # clojure-nl (1)
- # clojure-norway (23)
- # clojure-uk (5)
- # clojuredesign-podcast (8)
- # cloverage (1)
- # conjure (1)
- # data-science (1)
- # datahike (36)
- # datavis (1)
- # datomic (23)
- # emacs (14)
- # hyperfiddle (28)
- # lsp (5)
- # missionary (1)
- # music (1)
- # off-topic (11)
- # re-frame (11)
- # reitit (5)
- # releases (1)
- # shadow-cljs (65)
- # spacemacs (13)
- # squint (33)
- # tools-deps (56)
do folks have a workflow to deprecate a var without having to immediately refactor all current usages (but not introduce new ones)?
was wondering if there’s any approaches to ensure at least no new code is added that uses it in the meantime
I don't know if "yes" was an answer to my or phill's question. Can you please state the question without any ambiguitiy?
my question is if there’s any clj-kondo based approaches folks are using to deprecate a var with the help of clj-kondo
this is a closed source project so there’s no need to keep the var around once it’s unused
clj-kondo doesn't have the concept of "vars used since $timestamp" but what you can do is filter out the warnings that exist at $timestamp
> what you can do is filter out the warnings that exist at $timestamp how could that work?
> how could that work? This approach has been used before by nextjournal I think, just keep track of the existing warnings at $timestamp and "subtract" those from new warnings
the var in question is dissoc-nil-vals
btw. We use it quite a bit when creating datomic transaction maps. What I don’t like about it that it hides what can and can’t be nil. I’d like to refactor it to cond->
but if you think something is mandatory and it’s actually optional we get transaction failures…
@U5H74UNSF is this function only used in that project or also in other libs?
if it's only in the project, you could do this: rename the function to dissoc-nil-vals-DEPRECATED-no-longer-use-this
(using clojure-lsp or IntelliJ or any other tool that can rename vars properly). Then it will become very obvious in code review that you should not introduce new usages of this var