diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn new file mode 100644 index 0000000..6bb9e0d --- /dev/null +++ b/.clj-kondo/config.edn @@ -0,0 +1 @@ +{:config-paths ["../resources/clj-kondo.exports/mount/mount/"]} diff --git a/.gitignore b/.gitignore index 7f22d8e..dd11005 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ doo-index.html /.nrepl-history .cljs_rhino_repl/ out/ +.clj-kondo/.cache diff --git a/resources/clj-kondo.exports/mount/mount/config.edn b/resources/clj-kondo.exports/mount/mount/config.edn index 7cbb873..231300a 100644 --- a/resources/clj-kondo.exports/mount/mount/config.edn +++ b/resources/clj-kondo.exports/mount/mount/config.edn @@ -1,3 +1,3 @@ -{:lint-as {mount.core/defstate clojure.core/def-catch-all} - :linters {:mount/defstate {:level :warning}} - :hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate}}} +{:linters {:mount/defstate {:level :warning}} + :hooks {:analyze-call {mount.core/defstate hooks.defstate/defstate + mount.core/defstate! hooks.defstate/defstate}}} diff --git a/resources/clj-kondo.exports/hooks/defstate.clj b/resources/clj-kondo.exports/mount/mount/hooks/defstate.clj similarity index 87% rename from resources/clj-kondo.exports/hooks/defstate.clj rename to resources/clj-kondo.exports/mount/mount/hooks/defstate.clj index f8e7aca..16a4e8f 100644 --- a/resources/clj-kondo.exports/hooks/defstate.clj +++ b/resources/clj-kondo.exports/mount/mount/hooks/defstate.clj @@ -32,8 +32,10 @@ :col (:col (meta n))}) :else {:node (api/list-node - (list* - (api/token-node 'fn*) - (api/vector-node [n]) + (list + (api/token-node 'def) n - args))}))) + (api/list-node + (list* + (api/token-node 'do) + args))))}))) diff --git a/test/clj/tapp/utils/datomic.clj b/test/clj/tapp/utils/datomic.clj index 321f0d7..847eb35 100644 --- a/test/clj/tapp/utils/datomic.clj +++ b/test/clj/tapp/utils/datomic.clj @@ -6,8 +6,9 @@ (defn entity [conn id] (d/entity (d/db conn) id)) -(defn touch [conn results] +(defn touch "takes 'entity ids' results from a query e.g. '#{[272678883689461] [272678883689462] [272678883689459] [272678883689457]}'" + [conn results] (let [e (partial entity conn)] (map #(-> % first e d/touch) results)))