fixes #187 by adding exported clj-kondo config
This commit is contained in:
parent
5d68f59608
commit
99f814bb25
6 changed files with 37 additions and 0 deletions
1
.clj-kondo/com.github.seancorfield/next.jdbc/config.edn
Normal file
1
.clj-kondo/com.github.seancorfield/next.jdbc/config.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
{:hooks {:analyze-call {next.jdbc/with-transaction hooks.next-jdbc/with-transaction}}}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
(ns hooks.next-jdbc
|
||||
(:require [clj-kondo.hooks-api :as api]))
|
||||
|
||||
(defn with-transaction [{:keys [:node]}]
|
||||
(let [[binding-vec & body] (rest (:children node))
|
||||
[sym val opts] (:children binding-vec)]
|
||||
(when-not (and sym val)
|
||||
(throw (ex-info "No sym and val provided" {})))
|
||||
(let [new-node (api/list-node
|
||||
(list*
|
||||
(api/token-node 'let)
|
||||
(api/vector-node [sym val])
|
||||
opts
|
||||
body))]
|
||||
{:node new-node})))
|
||||
1
.clj-kondo/config.edn
Normal file
1
.clj-kondo/config.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
{:config-paths ["com.github.seancorfield/next.jdbc"]}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
Only accretive/fixative changes will be made from now on.
|
||||
|
||||
* 1.2.next in progress
|
||||
* Address #187 by adding `clj-kondo.exports` for future expansion (`with-transaction` is already built into `clj-kondo`).
|
||||
* Documentation updates; `pom.xml` template cleanup.
|
||||
|
||||
* 1.2.737 -- 2021-10-17
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
{:hooks {:analyze-call {next.jdbc/with-transaction hooks.next-jdbc/with-transaction}}}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
(ns hooks.next-jdbc
|
||||
(:require [clj-kondo.hooks-api :as api]))
|
||||
|
||||
(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)
|
||||
(throw (ex-info "No sym and val provided" {})))
|
||||
(let [new-node (api/list-node
|
||||
(list*
|
||||
(api/token-node 'let)
|
||||
(api/vector-node [sym val])
|
||||
opts
|
||||
body))]
|
||||
{:node new-node})))
|
||||
Loading…
Reference in a new issue