Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix clj-kondo errors regarding Nippy (#73985)

Oleksandr Yakushev26c768c48ddb
diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn
index 095ded7bdb3..29d3a236096 100644
--- a/.clj-kondo/config.edn
+++ b/.clj-kondo/config.edn
@@ -260,9 +260,7 @@
(metabase.driver-api.core/replace-in)
(metabase.query-processor.middleware.cache-backend.interface/with-cached-results)
(metabase.util.regex/rx [opt])
- (metabase.util/prog1 [<>])
- (taoensso.nippy/extend-freeze)
- (taoensso.nippy/extend-thaw)]}
+ (metabase.util/prog1 [<>])]}
;; TODO (Cam 8/22/25) -- what's the point of marking stuff deprecated if we don't have Kondo enforce it? We should
;; remove all of these and add individual ignores as needed.
@@ -685,7 +683,9 @@
metabase.util.malli.registry/def hooks.metabase.util.malli.registry/def
metabase.util/case-enum hooks.metabase.util/case-enum
metabase.util/format-color hooks.metabase.util/format-color
- metabase.xrays.api.automagic-dashboards-test/with-indexed-model! hooks.metabase.xrays.api.automagic-dashboards-test/with-indexed-model!}
+ metabase.xrays.api.automagic-dashboards-test/with-indexed-model! hooks.metabase.xrays.api.automagic-dashboards-test/with-indexed-model!
+ taoensso.nippy/extend-freeze hooks.taoensso.nippy/extend-freeze
+ taoensso.nippy/extend-thaw hooks.taoensso.nippy/extend-thaw}
:macroexpand
{clojurewerkz.quartzite.jobs/build macros.quartz/build-job
diff --git a/.clj-kondo/src/hooks/taoensso/nippy.clj b/.clj-kondo/src/hooks/taoensso/nippy.clj
new file mode 100644
index 00000000000..4ffc2adac81
--- /dev/null
+++ b/.clj-kondo/src/hooks/taoensso/nippy.clj
@@ -0,0 +1,22 @@
+(ns hooks.taoensso.nippy
+ (:require [clj-kondo.hooks-api :as api]))
+
+(defn extend-thaw
+ [{:keys [node]}]
+ (let [[_ _ arglist & body] (:children node)]
+ {:node (with-meta (api/list-node
+ (list*
+ (api/token-node 'fn)
+ arglist
+ body))
+ (meta node))}))
+
+(defn extend-freeze
+ [{:keys [node]}]
+ (let [[_ _ _ arglist & body] (:children node)]
+ {:node (with-meta (api/list-node
+ (list*
+ (api/token-node 'fn)
+ arglist
+ body))
+ (meta node))}))