diff --git a/.clj-kondo/babashka/fs/config.edn b/.clj-kondo/babashka/fs/config.edn deleted file mode 100644 index 23f36094841645789ab4a73f555c21fb5fd9ccc7..0000000000000000000000000000000000000000 --- a/.clj-kondo/babashka/fs/config.edn +++ /dev/null @@ -1 +0,0 @@ -{:lint-as {babashka.fs/with-temp-dir clojure.core/let}} diff --git a/.clj-kondo/babashka/sci/config.edn b/.clj-kondo/babashka/sci/config.edn deleted file mode 100644 index 60ea30d04f3fe591599563b5f30f0e854197a5d8..0000000000000000000000000000000000000000 --- a/.clj-kondo/babashka/sci/config.edn +++ /dev/null @@ -1 +0,0 @@ -{:hooks {:macroexpand {sci.core/copy-ns sci.core/copy-ns}}} diff --git a/.clj-kondo/babashka/sci/sci/core.clj b/.clj-kondo/babashka/sci/sci/core.clj deleted file mode 100644 index ac324eecad5226764c8db8f42522dfb56577591f..0000000000000000000000000000000000000000 --- a/.clj-kondo/babashka/sci/sci/core.clj +++ /dev/null @@ -1,9 +0,0 @@ -(ns sci.core) - -(defmacro copy-ns - ([ns-sym sci-ns] - `(copy-ns ~ns-sym ~sci-ns nil)) - ([ns-sym sci-ns opts] - `[(quote ~ns-sym) - ~sci-ns - (quote ~opts)])) diff --git a/.clj-kondo/better-cond/better-cond/better_cond/core.clj b/.clj-kondo/better-cond/better-cond/better_cond/core.clj deleted file mode 100644 index 329d3db9d046f729ebc7449e9b71772122832897..0000000000000000000000000000000000000000 --- a/.clj-kondo/better-cond/better-cond/better_cond/core.clj +++ /dev/null @@ -1,145 +0,0 @@ -(ns better-cond.core - "A clj-kondo hook to allow linting of better-cond `cond` macro. - This supports better-cond version 2.0.0+. - - To use in a project, change the namespace to hooks.better-cond, - put this code in file .clj-kondo/hooks/better_cond.clj, and include - a config.edn entry in the :hooks key like: - - :hooks {:analyze-call {better-cond.core/cond hooks.better-cond/cond}} - - Note that the expansion of :when-let and :when-some forms currently - takes a shortcut that *would* lead to incorrect values in some - cases of restructuring during actual expansion/evaluation, e.g., - :when-let [[x y] nil] would not abort the cond, though :when-let - [[x y] [nil nil]] would. However, for linting purposes, the current - expansion approach works just fine. It seems unnecessary to do the - full expansion in these cases for linting purposes, though that could - be done if needed." - (:refer-clojure :exclude [cond]) - (:require - [clj-kondo.hooks-api :as api] - [clojure.string :as str])) - -(def better-cond-simple-keys - "Special constructs in better cond, either as keywords or symbols. - This includes those keys that are simply transformed. Note that - :when-let and :when-some are *not* included as better-cond allows - multiple bindings but clojure does not. These two must be handled - separately." - #{:let :when :do - 'let 'when 'do}) - -(def better-cond-complex-keys - "Special constructs in better cond, either as keywords or symbols. - This includes those keys that require a multi-step transformation. - For example, :when-let and :when-some get converted to a let - wrapping a when, wrapping the continuing cond. Note that clojure - does not support multiple bindings in the standard when-let and - when-some macros." - {:when-let 'identity - 'when-let 'identity - :when-some 'some? - 'when-some 'some?}) - -(defn extract-binding-forms - [bindings] - (keep-indexed #(when (even? %1) %2) bindings)) - -(defn process-pairs - "Transforms a `cond` with the clauses given as a collection of explicit pairs. - Handles all the special better-cond constructs as keywords or symbols. - Returns a rewrite-clj list-node representing the transformed code." - [node-pairs] - (loop [[[lhs rhs :as pair] & pairs] node-pairs - new-body [(api/token-node 'clojure.core/cond)]] ; Avoid reprocessing the cond with ns here - (if pair - (let [lhs-sexpr (api/sexpr lhs)] - (clojure.core/cond - (= 1 (count pair)) ;; better-cond allows single clause for default - , (api/list-node (conj new-body (api/keyword-node :else) lhs)) - (better-cond-simple-keys lhs-sexpr) ;; Handle special better-cond constructs - , (api/list-node - (conj new-body - (api/keyword-node :else) - (api/list-node [(api/token-node (symbol #_"clojure.core" (name lhs-sexpr))) - rhs - (process-pairs pairs)]))) - (better-cond-complex-keys lhs-sexpr) ;; Multi stage constructs - , (api/list-node - (conj new-body - (api/keyword-node :else) - (api/list-node [(api/token-node 'let) - rhs - (api/list-node [(api/token-node 'when) - (api/list-node ;; ATTN: shortcut here; fine for linting - [(api/token-node 'every?) - (api/token-node (better-cond-complex-keys lhs-sexpr)) - (api/vector-node (->> rhs - api/sexpr - extract-binding-forms - (map api/token-node)))]) - (process-pairs pairs)])]))) - :else - , (recur pairs (conj new-body lhs rhs)))) - (api/list-node new-body)))) - -(defn cond-hook - [{:keys [node]}] - (let [expr (let [args (rest (:children node)) - pairs (partition-all 2 args)] - (process-pairs pairs))] - {:node (with-meta expr - (meta node))})) - -(defn process-if-let-pairs [pairs then else] - (if (seq pairs) - (let [[lhs rhs] (first pairs)] - (if (and (api/keyword-node? lhs) - (= :let (api/sexpr lhs))) - (api/list-node (conj [(api/token-node 'clojure.core/let) rhs - (process-if-let-pairs (next pairs) then else)])) - (let [test (api/token-node (gensym "test"))] - (api/list-node - (conj [(api/token-node 'clojure.core/let) (api/vector-node [test rhs]) - (api/list-node [(api/token-node 'if) test - (api/list-node - [(api/token-node 'clojure.core/let) - (api/vector-node [lhs test]) - (process-if-let-pairs (next pairs) then else)]) - else])]))))) - then)) - -(defn if-let-hook - [{:keys [node]}] - (let [expr (let [[binding-vec then else] (rest (:children node)) - pairs (partition-all 2 (:children binding-vec)) - node (process-if-let-pairs pairs then else)] - node)] - {:node (with-meta expr - (meta node))})) - -(defn when-let-hook - [{:keys [node]}] - (let [expr (let [[binding-vec & body] (rest (:children node))] - (api/list-node - [(api/token-node 'better-cond.core/if-let) - binding-vec - (api/list-node (list* (api/token-node 'do) - body))]))] - {:node (with-meta expr - (meta node))})) - -(defn defnc-hook [{:keys [node]}] - (let [[defnc-node name-node arg-node & body] - (:children node) - new-node (api/list-node [(api/token-node (if (str/ends-with? (str defnc-node) - "defnc-") - 'clojure.core/defn- - 'clojure.core/defn)) - name-node - arg-node - (api/list-node - (list* (api/token-node 'better-cond.core/cond) - body))])] - {:node new-node})) diff --git a/.clj-kondo/better-cond/better-cond/config.edn b/.clj-kondo/better-cond/better-cond/config.edn deleted file mode 100644 index 4c54f54ee637965d18588a275f644be06bbb22e4..0000000000000000000000000000000000000000 --- a/.clj-kondo/better-cond/better-cond/config.edn +++ /dev/null @@ -1,9 +0,0 @@ -{:hooks - {:analyze-call - {better-cond.core/cond better-cond.core/cond-hook - better-cond.core/defnc better-cond.core/defnc-hook - better-cond.core/defnc- better-cond.core/defnc-hook - better-cond.core/if-let better-cond.core/if-let-hook - better-cond.core/if-some better-cond.core/if-let-hook - better-cond.core/when-let better-cond.core/when-let-hook - better-cond.core/when-some better-cond.core/when-let-hook}}} diff --git a/.clj-kondo/com.gfredericks/test.chuck/clj_kondo/com/gfredericks/test/chuck/checking.clj b/.clj-kondo/com.gfredericks/test.chuck/clj_kondo/com/gfredericks/test/chuck/checking.clj deleted file mode 100644 index 8df553fb774174ac92a430f899552da51037afbd..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.gfredericks/test.chuck/clj_kondo/com/gfredericks/test/chuck/checking.clj +++ /dev/null @@ -1,19 +0,0 @@ -(ns clj-kondo.com.gfredericks.test.chuck.checking - (:require - [clj-kondo.hooks-api :as api])) - -(defn checking - [{{:keys [children]} :node}] - (let [[_checking desc & opt+bindings+body] children - [opts binding-vec & body] (if (api/vector-node? (first opt+bindings+body)) - (into [(api/map-node {})] opt+bindings+body) - opt+bindings+body)] - (when-not (even? (count (:children binding-vec))) - (throw (ex-info "checking requires an even number of bindings" {}))) - {:node (api/list-node - (list* - (api/token-node 'let) - (api/vector-node (into [(api/token-node (symbol (gensym "_checking-desc"))) desc] - (:children binding-vec))) - opts - body))})) diff --git a/.clj-kondo/com.gfredericks/test.chuck/config.edn b/.clj-kondo/com.gfredericks/test.chuck/config.edn deleted file mode 100644 index 79dcc169007ea6719a0464850c9df2b1cb2fa387..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.gfredericks/test.chuck/config.edn +++ /dev/null @@ -1,4 +0,0 @@ -{:hooks - {:analyze-call - {com.gfredericks.test.chuck.clojure-test/checking - clj-kondo.com.gfredericks.test.chuck.checking/checking}}} diff --git a/.clj-kondo/com.github.camsaul/humane-are/config.edn b/.clj-kondo/com.github.camsaul/humane-are/config.edn deleted file mode 100644 index 880a8fb4dc9eb3ed507ca224b96da57c8bfb941d..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/humane-are/config.edn +++ /dev/null @@ -1,2 +0,0 @@ -{:lint-as - {humane-are.core/are+ clojure.test/are}} diff --git a/.clj-kondo/com.github.camsaul/toucan2/config.edn b/.clj-kondo/com.github.camsaul/toucan2/config.edn deleted file mode 100644 index 93cb85cf5e2a16b6dfe517a270048e79691db02d..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/config.edn +++ /dev/null @@ -1,39 +0,0 @@ -{:config-paths - ["macros"] - - :lint-as - {toucan2.core/build clojure.core/identity - toucan2.core/compile clojure.core/identity - toucan2.query/with-built-query clojure.core/let - toucan2.tools.compile/build clojure.core/identity - toucan2.tools.compile/compile clojure.core/identity} - - :hooks - {:analyze-call - {toucan2.connection/with-connection hooks.toucan2.connection/with-connection - toucan2.connection/with-transaction hooks.toucan2.connection/with-transaction - toucan2.core/with-connection hooks.toucan2.connection/with-connection - toucan2.core/with-transaction hooks.toucan2.connection/with-transaction - toucan2.tools.simple-out-transform/define-out-transform hooks.toucan2.tools.simple-out-transform/define-out-transform - toucan2.tools.with-temp/with-temp hooks.toucan2.tools.with-temp/with-temp} - - :macroexpand - {toucan.db/with-call-counting macros.toucan2.execute/with-call-count - toucan.models/defmodel macros.toucan.models/defmodel - toucan2.core/define-after-insert macros.toucan2.tools.after-insert/define-after-insert - toucan2.core/define-after-select macros.toucan2.tools.helpers/define-after-select - toucan2.core/define-after-update macros.toucan2.tools.after-update/define-after-update - toucan2.core/define-before-delete macros.toucan2.tools.helpers/define-before-delete - toucan2.core/define-before-insert macros.toucan2.tools.before-insert/define-before-insert - toucan2.core/define-before-select macros.toucan2.tools.helpers/define-before-select - toucan2.core/define-before-update macros.toucan2.tools.before-update/define-before-update - toucan2.execute/with-call-count macros.toucan2.execute/with-call-count - toucan2.tools.after-insert/define-after-insert macros.toucan2.tools.after-insert/define-after-insert - toucan2.tools.after-select/define-after-select macros.toucan2.tools.helpers/define-after-select - toucan2.tools.after-update/define-after-update macros.toucan2.tools.after-update/define-after-update - toucan2.tools.before-delete/define-before-delete macros.toucan2.tools.helpers/define-before-delete - toucan2.tools.before-insert/define-before-insert macros.toucan2.tools.before-insert/define-before-insert - toucan2.tools.before-select/define-before-select macros.toucan2.tools.helpers/define-before-select - toucan2.tools.before-update/define-before-update macros.toucan2.tools.before-update/define-before-update - toucan2.tools.default-fields/define-default-fields macros.toucan2.tools.default-fields/define-default-fields - toucan2.tools.named-query/define-named-query macros.toucan2.tools.named-query/define-named-query}}} diff --git a/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/connection.clj b/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/connection.clj deleted file mode 100644 index 7e4031e3163671ef567a7284b5163af169a791a8..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/connection.clj +++ /dev/null @@ -1,14 +0,0 @@ -(ns hooks.toucan2.connection - (:require [clj-kondo.hooks-api :as hooks])) - -(defn with-connection [{{[_ bindings & body] :children} :node}] - (let [[conn-binding connectable] (:children bindings)] - {:node (hooks/list-node - (list* - (hooks/token-node 'let) - (hooks/vector-node [conn-binding (or connectable - (hooks/token-node 'nil))]) - body))})) - -(defn with-transaction [node] - (with-connection node)) diff --git a/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/tools/simple_out_transform.clj b/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/tools/simple_out_transform.clj deleted file mode 100644 index db6677ff8261d435cb1ebe41616e1699dbc4a78a..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/tools/simple_out_transform.clj +++ /dev/null @@ -1,37 +0,0 @@ -(ns hooks.toucan2.tools.simple-out-transform - (:require [clj-kondo.hooks-api :as hooks])) - -(defn- ignore-unused-binding [x] - (vary-meta x assoc :clj-kondo/ignore [:unused-binding])) - -(defn define-out-transform - [{{[_define-out-transform dispatch-value {[instance-binding] :children, :as bindings} & body] :children, :as node} :node}] - {:node (-> (hooks/list-node - [(hooks/token-node 'do) - dispatch-value - (hooks/list-node - (list* - (hooks/token-node 'fn) - (-> (hooks/vector-node - [(ignore-unused-binding (with-meta (hooks/token-node '&query-type) (meta bindings))) - (ignore-unused-binding (with-meta (hooks/token-node '&model) (meta bindings))) - instance-binding]) - (with-meta (meta bindings))) - body))]) - (with-meta (meta node)))}) - -(comment - (defn test-define-out-transform [] - (as-> '(tools.simple-out-transform/define-out-transform [:toucan.query-type/select.instances ::after-select] - [instance] - (let [wow 1000] - ;; don't do after-select if this select is a result of doing something like insert-returning instances - (if (isa? &query-type :toucan2.pipeline/select.instances-from-pks) - instance - (after-select instance)))) <> - (hooks/parse-string (pr-str <>)) - (define-out-transform {:node <>}) - (:node <>) - (hooks/sexpr <>) - (binding [*print-meta* false #_true] - (clojure.pprint/pprint <>))))) diff --git a/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/tools/with_temp.clj b/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/tools/with_temp.clj deleted file mode 100644 index b66cf1b4c881d0863650605c4c9451e1d06fc750..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/hooks/toucan2/tools/with_temp.clj +++ /dev/null @@ -1,22 +0,0 @@ -(ns hooks.toucan2.tools.with-temp - (:require [clj-kondo.hooks-api :as hooks])) - -(defn with-temp [{{[_with-temp {bindings :children} & body] :children} :node}] - (let [bindings* (into - [] - (comp (partition-all 3) - (mapcat (fn [[model binding attributes]] - (let [binding (or binding (hooks/token-node '_)) - attributes (or attributes (hooks/token-node 'nil))] - [binding (hooks/list-node - (list - (hooks/token-node 'do) - model - attributes))])))) - bindings) - node* (hooks/list-node - (list* - (hooks/token-node 'let) - (hooks/vector-node bindings*) - body))] - {:node node*})) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan/models.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan/models.clj deleted file mode 100644 index 7c4b2a522c3aafbfc559fb212e9a3a9e16a108e2..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan/models.clj +++ /dev/null @@ -1,5 +0,0 @@ -(ns macros.toucan.models) - -(defmacro defmodel - [model _table-name] - `(def ~model "Docstring." ~(keyword (name model)))) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/common.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/common.clj deleted file mode 100644 index 4067fc484466f667e0755406a6dfe608e076bf84..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/common.clj +++ /dev/null @@ -1,4 +0,0 @@ -(ns macros.toucan2.common) - -(defn ignore-unused [symb] - (vary-meta symb assoc :clj-kondo/ignore [:unused-binding])) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/execute.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/execute.clj deleted file mode 100644 index 07397876b1d6d5dc8b9b6970b2dab0ed2abf7059..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/execute.clj +++ /dev/null @@ -1,6 +0,0 @@ -(ns macros.toucan2.execute) - -(defmacro with-call-count - [[call-count-fn-binding] & body] - `(let [~call-count-fn-binding (fn [])] - ~@body)) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/after_insert.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/after_insert.clj deleted file mode 100644 index 6f73f06771481e894f8d9a004afa78ff893f5491..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/after_insert.clj +++ /dev/null @@ -1,10 +0,0 @@ -(ns macros.toucan2.tools.after-insert - (:require [macros.toucan2.common :as common])) - -(defmacro define-after-insert - [model [instance-binding] & body] - `(do - ~model - (fn [~(common/ignore-unused '&model) - ~instance-binding] - ~@body))) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/after_update.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/after_update.clj deleted file mode 100644 index fe14d36ac0a76b0864fc8696e8f771acbf4bf3c4..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/after_update.clj +++ /dev/null @@ -1,10 +0,0 @@ -(ns macros.toucan2.tools.after-update - (:require [macros.toucan2.common :as common])) - -(defmacro define-after-update - [model [instance-binding] & body] - `(do - ~model - (fn [~(common/ignore-unused '&model) - ~instance-binding] - ~@body))) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/before_insert.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/before_insert.clj deleted file mode 100644 index 06ad6f550303f27f331f40c2ffd7ac76ee82aaa3..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/before_insert.clj +++ /dev/null @@ -1,10 +0,0 @@ -(ns macros.toucan2.tools.before-insert - (:require [macros.toucan2.common :as common])) - -(defmacro define-before-insert - [model [instance-binding] & body] - `(do - ~model - (fn [~(common/ignore-unused '&model) - ~instance-binding] - ~@body))) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/before_update.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/before_update.clj deleted file mode 100644 index b2334b1ddfc21acd4a70eb6adce997af55eb5b76..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/before_update.clj +++ /dev/null @@ -1,10 +0,0 @@ -(ns macros.toucan2.tools.before-update - (:require [macros.toucan2.common :as common])) - -(defmacro define-before-update - [model [instance-binding] & body] - `(do - ~model - (fn [~(common/ignore-unused '&model) - ~instance-binding] - ~@body))) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/default_fields.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/default_fields.clj deleted file mode 100644 index bbfbd074098d6e77c1da1f2b7cd761d1eb4239e9..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/default_fields.clj +++ /dev/null @@ -1,6 +0,0 @@ -(ns macros.toucan2.tools.default-fields - (:require [macros.toucan2.common :as common])) - -(defmacro define-default-fields [model & body] - `(let [~(common/ignore-unused '&model) ~model] - ~@body)) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/helpers.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/helpers.clj deleted file mode 100644 index 97050a36299eeb18daa1eaa72d441dabbc6ef2f8..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/helpers.clj +++ /dev/null @@ -1,27 +0,0 @@ -(ns macros.toucan2.tools.helpers - (:require [macros.toucan2.common :as common])) - -(defmacro define-before-select [dispatch-value [args-binding] & body] - `(do - ~dispatch-value - (fn [~(common/ignore-unused '&query-type) - ~(common/ignore-unused '&model) - ~args-binding] - ~@body))) - -(defmacro define-after-select [model [instance-binding] & body] - `(do - ~model - (fn [~(common/ignore-unused '&query-type) - ~(common/ignore-unused '&model) - ~(common/ignore-unused '&parsed-args) - ~instance-binding] - ~@body))) - -(defmacro define-before-delete - [model [instance-binding] & body] - `(do - ~model - (fn [~(common/ignore-unused '&model) - ~instance-binding] - ~@body))) diff --git a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/named_query.clj b/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/named_query.clj deleted file mode 100644 index a0dde729ca6c2137566d3152a9d03e17d1a3fbe6..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.camsaul/toucan2/macros/toucan2/tools/named_query.clj +++ /dev/null @@ -1,22 +0,0 @@ -(ns macros.toucan2.tools.named-query - (:require [macros.toucan2.common :as common])) - -;;; separate function because recursive macroexpansion doesn't seem to work. -(defn- define-named-query* - [query-name query-type model resolved-query] - `(do - ~query-name - ~query-type - ~model - (fn [~(common/ignore-unused '&query-type) - ~(common/ignore-unused '&model) - ~(common/ignore-unused '&parsed-args) - ~(common/ignore-unused '&unresolved-query)] - ~resolved-query))) - -(defmacro define-named-query - ([query-name resolved-query] - (define-named-query* query-name :default :default resolved-query)) - - ([query-name query-type model resolved-query] - (define-named-query* query-name query-type model resolved-query))) diff --git a/.clj-kondo/com.github.metabase/hawk/config.edn b/.clj-kondo/com.github.metabase/hawk/config.edn deleted file mode 100644 index a34a467365660370a99d2ad411532d41721dd11a..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.metabase/hawk/config.edn +++ /dev/null @@ -1,4 +0,0 @@ -{:linters - {:unresolved-symbol - {:exclude - [(clojure.test/is [partial= re= schema= =?])]}}} diff --git a/.clj-kondo/com.github.seancorfield/next.jdbc/config.edn b/.clj-kondo/com.github.seancorfield/next.jdbc/config.edn deleted file mode 100644 index c02325b37a9f6abbeeee559fa2c3373f5d4e3995..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.seancorfield/next.jdbc/config.edn +++ /dev/null @@ -1,8 +0,0 @@ -{:hooks - {:analyze-call - {next.jdbc/with-transaction - hooks.com.github.seancorfield.next-jdbc/with-transaction - next.jdbc/with-transaction+options - hooks.com.github.seancorfield.next-jdbc/with-transaction+options}} - :lint-as {next.jdbc/on-connection clojure.core/with-open - next.jdbc/on-connection+options clojure.core/with-open}} diff --git a/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj b/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj deleted file mode 100644 index d9ff567dcd89866d958dd97171ee32760b77dcfd..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj +++ /dev/null @@ -1,18 +0,0 @@ -(ns hooks.com.github.seancorfield.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}))) diff --git a/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj_kondo b/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj_kondo deleted file mode 100644 index 9fc398d85d7a3a6579d8f771cea245bd3c565d65..0000000000000000000000000000000000000000 --- a/.clj-kondo/com.github.seancorfield/next.jdbc/hooks/com/github/seancorfield/next_jdbc.clj_kondo +++ /dev/null @@ -1,34 +0,0 @@ -(ns hooks.com.github.seancorfield.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) per 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}))) - -(defn with-transaction+options - "Expands (with-transaction+options [tx expr opts] body) - to (let [tx expr] opts body) per 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}))) diff --git a/.clj-kondo/http-kit/http-kit/config.edn b/.clj-kondo/http-kit/http-kit/config.edn deleted file mode 100644 index e9dbcd8aa727659ccd53f2521dd17304b00273eb..0000000000000000000000000000000000000000 --- a/.clj-kondo/http-kit/http-kit/config.edn +++ /dev/null @@ -1,3 +0,0 @@ - -{:hooks - {:analyze-call {org.httpkit.server/with-channel httpkit.with-channel/with-channel}}} diff --git a/.clj-kondo/http-kit/http-kit/httpkit/with_channel.clj b/.clj-kondo/http-kit/http-kit/httpkit/with_channel.clj deleted file mode 100644 index b429de899705439e049a549b3b137759d6ca86a8..0000000000000000000000000000000000000000 --- a/.clj-kondo/http-kit/http-kit/httpkit/with_channel.clj +++ /dev/null @@ -1,16 +0,0 @@ -(ns httpkit.with-channel - (:require [clj-kondo.hooks-api :as api])) - -(defn with-channel [{node :node}] - (let [[request channel & body] (rest (:children node))] - (when-not (and request channel) (throw (ex-info "No request or channel provided" {}))) - (when-not (api/token-node? channel) (throw (ex-info "Missing channel argument" {}))) - (let [new-node - (api/list-node - (list* - (api/token-node 'let) - (api/vector-node [channel (api/vector-node [])]) - request - body))] - - {:node new-node}))) diff --git a/.clj-kondo/methodical/methodical/config.edn b/.clj-kondo/methodical/methodical/config.edn deleted file mode 100644 index ebb99b9c08aa1f9480d460cb676c905bde1df790..0000000000000000000000000000000000000000 --- a/.clj-kondo/methodical/methodical/config.edn +++ /dev/null @@ -1,14 +0,0 @@ -{:config-paths ["macros"] - - :lint-as - {} - - :hooks - {:analyze-call - {methodical.core/defmethod hooks.methodical.macros/defmethod - methodical.core/defmulti hooks.methodical.macros/defmulti - methodical.macros/defmethod hooks.methodical.macros/defmethod - methodical.macros/defmulti hooks.methodical.macros/defmulti} - - :macroexpand - {methodical.impl.combo.operator/defoperator macros.methodical.impl.combo.operator/defoperator}}} diff --git a/.clj-kondo/methodical/methodical/hooks/methodical/core.clj b/.clj-kondo/methodical/methodical/hooks/methodical/core.clj deleted file mode 100644 index c92a88940b34ef3f6833071aa16ba5a4ffa83600..0000000000000000000000000000000000000000 --- a/.clj-kondo/methodical/methodical/hooks/methodical/core.clj +++ /dev/null @@ -1,68 +0,0 @@ -(ns hooks.methodical.core - (:require [clj-kondo.hooks-api :as hooks])) - -(defn add-next-method [fn-tail] - (if (hooks/vector-node? (first fn-tail)) - (let [[args & body] fn-tail] - (list* - (-> (hooks/vector-node - (cons (hooks/token-node 'next-method) - (:children args))) - (with-meta (meta args))) - ;; so Kondo stops complaining about it being unused. - (hooks/token-node 'next-method) - body)) - (for [list-node fn-tail] - (hooks/list-node (add-next-method (:children list-node)))))) - -(defn defmethod - [{{[_ multimethod & [first-arg :as args]] :children, :as node} :node}] - #_(clojure.pprint/pprint (hooks/sexpr node)) - (let [[aux-qualifier dispatch-value & fn-tail] (if (#{:before :after :around} (hooks/sexpr first-arg)) - (cons (hooks/sexpr first-arg) (rest args)) - (cons nil args)) - fn-tail (if (contains? #{:around nil} aux-qualifier) - (add-next-method fn-tail) - fn-tail) - result (hooks/list-node - (list* (hooks/token-node 'clojure.core/defmethod) - multimethod - dispatch-value - fn-tail))] - #_(println "=>") - #_(clojure.pprint/pprint (hooks/sexpr result)) - {:node result})) - -(defn defmulti - [{{[_ multimethod-name & args] :children, :as node} :node}] - #_(clojure.pprint/pprint (hooks/sexpr node)) - (let [[docstring & args] (if (hooks/string-node? (first args)) - args - (cons nil args)) - [attribute-map & args] (if (hooks/map-node? (first args)) - args - (cons nil args)) - ;; if there wasn't a positional dispatch function arg passed just use (constantly nil) so Kondo won't complain - [dispatch-fn & kv-options] (if (odd? (count args)) - args - (cons (hooks/list-node - (list - (hooks/token-node 'clojure.core/constantly) - (hooks/token-node 'nil))) - args))] - (let [defmulti-form (hooks/list-node - (filter - some? - [(hooks/token-node 'clojure.core/defmulti) - multimethod-name - docstring - attribute-map - dispatch-fn])) - result (hooks/list-node - (list* - (hooks/token-node 'do) - defmulti-form - kv-options))] - #_(println "=>") - #_(clojure.pprint/pprint (hooks/sexpr result)) - {:node result}))) diff --git a/.clj-kondo/methodical/methodical/hooks/methodical/macros.clj b/.clj-kondo/methodical/methodical/hooks/methodical/macros.clj deleted file mode 100644 index 0bfb9ea583211ccb712840c13ab9165da76ed45d..0000000000000000000000000000000000000000 --- a/.clj-kondo/methodical/methodical/hooks/methodical/macros.clj +++ /dev/null @@ -1,185 +0,0 @@ -(ns hooks.methodical.macros - (:refer-clojure :exclude [defmulti defmethod]) - (:require - [clj-kondo.hooks-api :as hooks])) - -;;; The code below is basically simulating the spec for parsing defmethod args without using spec. It uses a basic -;;; backtracking algorithm to achieve a similar result. Parsing defmethod args is kinda complicated. -;;; -;;; Unfortunately this is hardcoded to `:before`, `:after`, and `:around` as the only allowed qualifiers for now... at -;;; some point in the future we'll have to figure out how to fix this and support other qualifiers too. - -(defn- bindings-vector? [x] - (and (hooks/vector-node? x) - (every? (some-fn hooks/token-node? - hooks/map-node? - hooks/vector-node?) - (:children x)))) - -(defn- single-arity-fn-tail? [args] - (bindings-vector? (first args))) - -(defn- n-arity-fn-tail? [args] - (and (seq args) - (every? (fn [x] - (and (hooks/list-node? x) - (single-arity-fn-tail? (:children x)))) - args))) - -(defn- fn-tail? [args] - (or (single-arity-fn-tail? args) - (n-arity-fn-tail? args))) - -(defn- qualifier? [x] - (and (hooks/keyword-node? x) - (#{:before :after :around} (hooks/sexpr x)))) - -(defn- dispatch-value? - "A dispatch value can be anything except for qualifier keyword or a list that looks like part of a n-arity function tail - e.g. `([x] x)`." - [x] - (and (not (qualifier? x)) - (or (not (hooks/list-node? x)) - (not (single-arity-fn-tail? (:children x)))))) - -(defonce ^:private backtrack (Exception.)) - -(defn- parse-defmethod-args - ([unparsed] - (let [parses (atom [])] - (try - (parse-defmethod-args parses {} unparsed) - (catch Exception _ - (when (zero? (count @parses)) - (throw (ex-info (format "Unable to parse defmethod args: %s" (pr-str (mapv hooks/sexpr unparsed))) - {:args (mapv hooks/sexpr unparsed)}))) - (when (> (count @parses) 1) - (throw (ex-info (format "Ambiguous defmethod args: %s" (pr-str (mapv hooks/sexpr unparsed))) - {:args (mapv hooks/sexpr unparsed) - :parses @parses}))) - (first @parses))))) - - ([parses parsed unparsed] - (cond - (and (not (contains? parsed :qualifier)) - (qualifier? (first unparsed))) - (try - (parse-defmethod-args parses (assoc parsed :qualifier (first unparsed)) (rest unparsed)) - (catch Exception _ - (parse-defmethod-args parses (assoc parsed :qualifier nil) unparsed))) - - (and (not (contains? parsed :dispatch-value)) - (dispatch-value? (first unparsed))) - (parse-defmethod-args parses (assoc parsed :dispatch-value (first unparsed)) (rest unparsed)) - - (not (contains? parsed :dispatch-value)) - (throw backtrack) - - (and (not (contains? parsed :unique-key)) - (:qualifier parsed) ; can only have unique keys for aux methods - (not (hooks/string-node? (first unparsed))) - (not (hooks/list-node? (first unparsed))) - (not (hooks/vector-node? (first unparsed)))) - (try - (parse-defmethod-args parses (assoc parsed :unique-key (first unparsed)) (rest unparsed)) - (catch Exception _ - (parse-defmethod-args parses (assoc parsed :unique-key nil) unparsed))) - - (and (not (contains? parsed :docstring)) - (hooks/string-node? (first unparsed))) - (try - (parse-defmethod-args parses (assoc parsed :docstring (first unparsed)) (rest unparsed)) - (catch Exception _ - (parse-defmethod-args parses (assoc parsed :docstring nil) unparsed))) - - (fn-tail? unparsed) - (do - (swap! parses conj (assoc parsed :fn-tail unparsed)) - (throw backtrack)) - - :else - (throw backtrack)))) - -(defn defmethod - [{{[_ multimethod & args] :children, :as node} :node}] - (#_println) - #_(clojure.pprint/pprint (hooks/sexpr node)) - (let [parsed (parse-defmethod-args args)] - #_(doseq [[k v] parsed] - (println \newline k '=> (pr-str (some-> v hooks/sexpr)))) - (let [fn-tail (:fn-tail parsed) - other-stuff (dissoc parsed :fn-tail) - result (hooks/list-node - (concat - [(hooks/token-node 'do) - multimethod] - (filter some? (vals other-stuff)) - [(-> (hooks/list-node - (list* - (hooks/token-node 'fn) - (hooks/token-node (if (contains? #{nil :around} (some-> (:qualifier parsed) hooks/sexpr)) - 'next-method - '__FN__NAME__THAT__YOU__CANNOT__REFER__TO__)) - fn-tail)) - (vary-meta update :clj-kondo/ignore conj :redundant-fn-wrapper))]))] - #_(println "=>") - #_(clojure.pprint/pprint (hooks/sexpr result)) - {:node result}))) - -;;; this stuff is for debugging things to make sure we didn't do something dumb -(comment - (defn defmethod* [form] - (binding [*print-meta* true] - (clojure.pprint/pprint - (hooks/sexpr (:node (defmethod {:node (hooks/parse-string (str form))})))))) - - (defmethod* '(defmethod mf :second [& _] 2)) - - (defmethod* '(m/defmethod multi-arity :k - ([x] - {:x x}) - ([x y] - {:x x, :y y}))) - - (defmethod* '(m/defmethod mf1 :docstring - "Docstring" - [_x])) - - (defmethod* '(m/defmethod mf1 :around :dispatch-value - "Docstring" - [x] - (next-method x)))) - -(defn defmulti - [{{[_ multimethod-name & args] :children, :as node} :node}] - #_(clojure.pprint/pprint (hooks/sexpr node)) - (let [[docstring & args] (if (hooks/string-node? (first args)) - args - (cons nil args)) - [attribute-map & args] (if (hooks/map-node? (first args)) - args - (cons nil args)) - ;; if there wasn't a positional dispatch function arg passed just use (constantly nil) so Kondo won't complain - [dispatch-fn & kv-options] (if (odd? (count args)) - args - (cons (hooks/list-node - (list - (hooks/token-node 'clojure.core/constantly) - (hooks/token-node 'nil))) - args))] - (let [defmulti-form (hooks/list-node - (filter - some? - [(hooks/token-node 'clojure.core/defmulti) - multimethod-name - docstring - attribute-map - dispatch-fn])) - result (hooks/list-node - (list* - (hooks/token-node 'do) - defmulti-form - kv-options))] - #_(println "=>") - #_(clojure.pprint/pprint (hooks/sexpr result)) - {:node result}))) diff --git a/.clj-kondo/methodical/methodical/macros/methodical/impl/combo/operator.clj b/.clj-kondo/methodical/methodical/macros/methodical/impl/combo/operator.clj deleted file mode 100644 index 9be0ad739e1ebbcf591305de8a07477464c332c3..0000000000000000000000000000000000000000 --- a/.clj-kondo/methodical/methodical/macros/methodical/impl/combo/operator.clj +++ /dev/null @@ -1,7 +0,0 @@ -(ns macros.methodical.impl.combo.operator) - -;; not exactly what actually happens but this is close enough to be able to lint it -(defmacro defoperator [operator-name [methods-binding invoke-binding] & body] - `(defmethod methodical.impl.combo.operator/operator ~(keyword operator-name) - [~methods-binding ~invoke-binding] - ~@body)) diff --git a/.clj-kondo/metosin/malli/config.edn b/.clj-kondo/metosin/malli/config.edn deleted file mode 100644 index 0f8b25ccfd9c80aefea40f69399f90ce801f133f..0000000000000000000000000000000000000000 --- a/.clj-kondo/metosin/malli/config.edn +++ /dev/null @@ -1,2 +0,0 @@ -{:lint-as {malli.experimental/defn schema.core/defn} - :linters {:unresolved-symbol {:exclude [(malli.core/=>)]}}} diff --git a/.clj-kondo/potemkin/potemkin/config.edn b/.clj-kondo/potemkin/potemkin/config.edn deleted file mode 100644 index 3f59f3e89dd75aa94c3e4bcf147ebf2e468d7c9f..0000000000000000000000000000000000000000 --- a/.clj-kondo/potemkin/potemkin/config.edn +++ /dev/null @@ -1,62 +0,0 @@ -{:lint-as {potemkin.collections/compile-if clojure.core/if - potemkin.collections/reify-map-type clojure.core/reify - potemkin.collections/def-map-type clj-kondo.lint-as/def-catch-all - potemkin.collections/def-derived-map clj-kondo.lint-as/def-catch-all - - potemkin.types/reify+ clojure.core/reify - potemkin.types/defprotocol+ clojure.core/defprotocol - potemkin.types/deftype+ clojure.core/deftype - potemkin.types/defrecord+ clojure.core/defrecord - potemkin.types/definterface+ clojure.core/defprotocol - potemkin.types/extend-protocol+ clojure.core/extend-protocol - potemkin.types/def-abstract-type clj-kondo.lint-as/def-catch-all - - potemkin.utils/doit clojure.core/doseq - potemkin.utils/doary clojure.core/doseq - potemkin.utils/condp-case clojure.core/condp - potemkin.utils/fast-bound-fn clojure.core/bound-fn - - potemkin.walk/prewalk clojure.walk/prewalk - potemkin.walk/postwalk clojure.walk/postwalk - potemkin.walk/walk clojure.walk/walk - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;;;; top-level from import-vars - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - ;; Have hooks - ;;potemkin/import-fn potemkin.namespaces/import-fn - ;;potemkin/import-macro potemkin.namespaces/import-macro - ;;potemkin/import-def potemkin.namespaces/import-def - - ;; Internal, not transitive - ;;potemkin/unify-gensyms potemkin.macros/unify-gensyms - ;;potemkin/normalize-gensyms potemkin.macros/normalize-gensyms - ;;potemkin/equivalent? potemkin.macros/equivalent? - - potemkin/condp-case clojure.core/condp - potemkin/doit potemkin.utils/doit - potemkin/doary potemkin.utils/doary - - potemkin/def-abstract-type clj-kondo.lint-as/def-catch-all - potemkin/reify+ clojure.core/reify - potemkin/defprotocol+ clojure.core/defprotocol - potemkin/deftype+ clojure.core/deftype - potemkin/defrecord+ clojure.core/defrecord - potemkin/definterface+ clojure.core/defprotocol - potemkin/extend-protocol+ clojure.core/extend-protocol - - potemkin/reify-map-type clojure.core/reify - potemkin/def-derived-map clj-kondo.lint-as/def-catch-all - potemkin/def-map-type clj-kondo.lint-as/def-catch-all} - - ;; leave import-vars alone, kondo special-cases it - :hooks {:macroexpand {#_#_potemkin.namespaces/import-vars potemkin.namespaces/import-vars - potemkin.namespaces/import-fn potemkin.namespaces/import-fn - potemkin.namespaces/import-macro potemkin.namespaces/import-macro - potemkin.namespaces/import-def potemkin.namespaces/import-def - - #_#_potemkin/import-vars potemkin.namespaces/import-vars - potemkin/import-fn potemkin.namespaces/import-fn - potemkin/import-macro potemkin.namespaces/import-macro - potemkin/import-def potemkin.namespaces/import-def}}} diff --git a/.clj-kondo/potemkin/potemkin/potemkin/namespaces.clj b/.clj-kondo/potemkin/potemkin/potemkin/namespaces.clj deleted file mode 100644 index a247af5cd5bfbaf3a154941f5d9a019ca7729b00..0000000000000000000000000000000000000000 --- a/.clj-kondo/potemkin/potemkin/potemkin/namespaces.clj +++ /dev/null @@ -1,56 +0,0 @@ -(ns potemkin.namespaces - (:require [clj-kondo.hooks-api :as api])) - -(defn import-macro* - ([sym] - `(def ~(-> sym name symbol) ~sym)) - ([sym name] - `(def ~name ~sym))) - -(defmacro import-fn - ([sym] - (import-macro* sym)) - ([sym name] - (import-macro* sym name))) - -(defmacro import-macro - ([sym] - (import-macro* sym)) - ([sym name] - (import-macro* sym name))) - -(defmacro import-def - ([sym] - (import-macro* sym)) - ([sym name] - (import-macro* sym name))) - -#_ -(defmacro import-vars - "Imports a list of vars from other namespaces." - [& syms] - (let [unravel (fn unravel [x] - (if (sequential? x) - (->> x - rest - (mapcat unravel) - (map - #(symbol - (str (first x) - (when-let [n (namespace %)] - (str "." n))) - (name %)))) - [x])) - syms (mapcat unravel syms) - result `(do - ~@(map - (fn [sym] - (let [vr (resolve sym) - m (meta vr)] - (cond - (nil? vr) `(throw (ex-info (format "`%s` does not exist" '~sym) {})) - (:macro m) `(def ~(-> sym name symbol) ~sym) - (:arglists m) `(def ~(-> sym name symbol) ~sym) - :else `(def ~(-> sym name symbol) ~sym)))) - syms))] - result)) diff --git a/.clj-kondo/prismatic/schema/config.edn b/.clj-kondo/prismatic/schema/config.edn deleted file mode 100644 index 2c341bced2ab069b55c3cf3d07c543c24d67fd99..0000000000000000000000000000000000000000 --- a/.clj-kondo/prismatic/schema/config.edn +++ /dev/null @@ -1 +0,0 @@ -{:lint-as {schema.test/deftest clojure.test/deftest}} diff --git a/.clj-kondo/test.clj b/.clj-kondo/test.clj deleted file mode 100644 index 5630f7de300ecf7dc5e59eb92362eb9f0527d219..0000000000000000000000000000000000000000 --- a/.clj-kondo/test.clj +++ /dev/null @@ -1,10 +0,0 @@ -(ns test - (:require [metabase.query-processor.streaming :as streaming] - [toucan.models :as models])) - -(models/defmodel Card :foo) - -(map->Card {:foo 1}) -(map->CardInstance {:foo 1}) - -(streaming/streaming-response [x 1 (inc x)]) diff --git a/.gitignore b/.gitignore index 61f5d9427d6e49c6431b883e98d2d5a3331828f7..4a0a088168b9660c3f33d184324d3ae558640fef 100644 --- a/.gitignore +++ b/.gitignore @@ -90,6 +90,13 @@ modules/drivers/*/.lsp/* !modules/drivers/*/.lsp/config.edn **/.clj-kondo/.cache +# clj-kondo: ignore all except our defined config +.clj-kondo/* +!.clj-kondo/README.md +!.clj-kondo/config.edn +!.clj-kondo/hooks/ +!.clj-kondo/macros/ + # Editor- or environment-specific local files *.code-workspace .java-version