From de1229cce2cacc314b912adda3be26c65436031f Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sun, 7 Nov 2021 13:23:03 -0800 Subject: [PATCH] move hooks to properly namespaced folder --- .clj-kondo/com.github.seancorfield/next.jdbc/config.edn | 5 ++++- .../next.jdbc/hooks/com/github/seancorfield}/next_jdbc.clj | 2 +- .../com.github.seancorfield/next.jdbc/config.edn | 5 ++++- .../next.jdbc/hooks/com/github/seancorfield}/next_jdbc.clj | 7 +++++-- 4 files changed, 14 insertions(+), 5 deletions(-) rename {resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks => .clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield}/next_jdbc.clj (93%) rename {.clj-kondo/com.github.seancorfield/next.jdbc/hooks => resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield}/next_jdbc.clj (70%) diff --git a/.clj-kondo/com.github.seancorfield/next.jdbc/config.edn b/.clj-kondo/com.github.seancorfield/next.jdbc/config.edn index f49521a..a67a5c6 100644 --- a/.clj-kondo/com.github.seancorfield/next.jdbc/config.edn +++ b/.clj-kondo/com.github.seancorfield/next.jdbc/config.edn @@ -1 +1,4 @@ -{:hooks {:analyze-call {next.jdbc/with-transaction hooks.next-jdbc/with-transaction}}} +{:hooks + {:analyze-call + {next.jdbc/with-transaction + hooks.com.github.seancorfield.next-jdbc/with-transaction}}} diff --git a/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/next_jdbc.clj b/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj similarity index 93% rename from resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/next_jdbc.clj rename to .clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj index e881dbf..d9ff567 100644 --- a/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/next_jdbc.clj +++ b/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj @@ -1,4 +1,4 @@ -(ns hooks.next-jdbc +(ns hooks.com.github.seancorfield.next-jdbc (:require [clj-kondo.hooks-api :as api])) (defn with-transaction diff --git a/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/config.edn b/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/config.edn index f49521a..a67a5c6 100644 --- a/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/config.edn +++ b/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/config.edn @@ -1 +1,4 @@ -{:hooks {:analyze-call {next.jdbc/with-transaction hooks.next-jdbc/with-transaction}}} +{:hooks + {:analyze-call + {next.jdbc/with-transaction + hooks.com.github.seancorfield.next-jdbc/with-transaction}}} diff --git a/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/next_jdbc.clj b/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj similarity index 70% rename from .clj-kondo/com.github.seancorfield/next.jdbc/hooks/next_jdbc.clj rename to resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj index 29f127e..d9ff567 100644 --- a/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/next_jdbc.clj +++ b/resources/clj-kondo.exports/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj @@ -1,7 +1,10 @@ -(ns hooks.next-jdbc +(ns hooks.com.github.seancorfield.next-jdbc (:require [clj-kondo.hooks-api :as api])) -(defn with-transaction [{:keys [:node]}] +(defn with-transaction + "Expands (with-transaction [tx expr opts] body) + to (let [tx expr] opts body) pre clj-kondo examples." + [{:keys [:node]}] (let [[binding-vec & body] (rest (:children node)) [sym val opts] (:children binding-vec)] (when-not (and sym val)