Skip to content

Commit 25a6688

Browse files
Merge pull request #36 from clj-codes/bump/deps-2024-07
bump: clojure deps
2 parents 04413a3 + 420526f commit 25a6688

File tree

10 files changed

+237
-28
lines changed

10 files changed

+237
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; Copyright 2024 Nubank NA
2+
3+
; The use and distribution terms for this software are covered by the
4+
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0)
5+
; which can be found in the file epl-v10.html at the root of this distribution.
6+
;
7+
; By using this software in any fashion, you are agreeing to be bound by
8+
; the terms of this license.
9+
;
10+
; You must not remove this notice, or any other, from this software.
11+
12+
{:hooks
13+
{:analyze-call
14+
{io.pedestal.log/trace hooks.io.pedestal.log/log-expr
15+
io.pedestal.log/debug hooks.io.pedestal.log/log-expr
16+
io.pedestal.log/info hooks.io.pedestal.log/log-expr
17+
io.pedestal.log/warn hooks.io.pedestal.log/log-expr
18+
io.pedestal.log/error hooks.io.pedestal.log/log-expr}}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; Copyright 2024 Nubank NA
2+
3+
; The use and distribution terms for this software are covered by the
4+
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0)
5+
; which can be found in the file epl-v10.html at the root of this distribution.
6+
;
7+
; By using this software in any fashion, you are agreeing to be bound by
8+
; the terms of this license.
9+
;
10+
; You must not remove this notice, or any other, from this software.
11+
12+
(ns hooks.io.pedestal.log
13+
(:require [clj-kondo.hooks-api :as api]))
14+
15+
(defn log-expr
16+
"Expands (log-expr :a :A :b :B ... )
17+
to (hash-map :a :A :b :B ... ) per clj-kondo examples."
18+
[{:keys [:node]}]
19+
(let [[k v & _kvs] (rest (:children node))]
20+
(when-not (and k v)
21+
(throw (ex-info "No kv pair provided" {})))
22+
(let [new-node (api/list-node
23+
(list*
24+
(api/token-node 'hash-map)
25+
(rest (:children node))))]
26+
{:node (vary-meta new-node assoc :clj-kondo/ignore [:unused-value])})))

.clj-kondo/nubank/state-flow/nubank/state_flow.clj

+23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(ns nubank.state-flow
2+
(:refer-clojure :exclude [with-redefs])
23
(:require [clj-kondo.hooks-api :as hooks]))
34

45
(defn- normalize-mlet-binds
@@ -33,3 +34,25 @@
3334
(do-let body)])]
3435
{:node (with-meta new-node (meta node))
3536
:defined-by 'state-flow.cljtest/defflow}))
37+
38+
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
39+
(defn with-redefs
40+
"This transformation hook converts
41+
42+
(state-flow.labs.state/with-redefs [bindings & flows])
43+
44+
into
45+
46+
(clojure.core/with-redefs bindings
47+
(state-flow.core/flow \"state-flow.labs.state/with-redefs\" flows))"
48+
[{:keys [node]}]
49+
(let [[bindings & flows] (rest (:children node))
50+
new-node (hooks/list-node
51+
[(hooks/token-node 'clojure.core/with-redefs)
52+
bindings
53+
(hooks/list-node
54+
(concat [(hooks/token-node 'state-flow.api/flow)
55+
(hooks/string-node "state-flow.labs.state/with-redefs")]
56+
flows))])]
57+
{:node (with-meta new-node (meta node))
58+
:defined-by 'state-flow.labs.state/with-redefs}))
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{:lint-as {potemkin.collections/compile-if clojure.core/if
2+
potemkin.collections/reify-map-type clojure.core/reify
3+
potemkin.collections/def-map-type clj-kondo.lint-as/def-catch-all
4+
potemkin.collections/def-derived-map clj-kondo.lint-as/def-catch-all
5+
6+
potemkin.types/reify+ clojure.core/reify
7+
potemkin.types/defprotocol+ clojure.core/defprotocol
8+
potemkin.types/deftype+ clojure.core/deftype
9+
potemkin.types/defrecord+ clojure.core/defrecord
10+
potemkin.types/definterface+ clojure.core/defprotocol
11+
potemkin.types/extend-protocol+ clojure.core/extend-protocol
12+
potemkin.types/def-abstract-type clj-kondo.lint-as/def-catch-all
13+
14+
potemkin.utils/doit clojure.core/doseq
15+
potemkin.utils/doary clojure.core/doseq
16+
potemkin.utils/condp-case clojure.core/condp
17+
potemkin.utils/fast-bound-fn clojure.core/bound-fn
18+
19+
potemkin.walk/prewalk clojure.walk/prewalk
20+
potemkin.walk/postwalk clojure.walk/postwalk
21+
potemkin.walk/walk clojure.walk/walk
22+
23+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
24+
;;;; top-level from import-vars
25+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26+
27+
;; Have hooks
28+
;;potemkin/import-fn potemkin.namespaces/import-fn
29+
;;potemkin/import-macro potemkin.namespaces/import-macro
30+
;;potemkin/import-def potemkin.namespaces/import-def
31+
32+
;; Internal, not transitive
33+
;;potemkin/unify-gensyms potemkin.macros/unify-gensyms
34+
;;potemkin/normalize-gensyms potemkin.macros/normalize-gensyms
35+
;;potemkin/equivalent? potemkin.macros/equivalent?
36+
37+
potemkin/condp-case clojure.core/condp
38+
potemkin/doit potemkin.utils/doit
39+
potemkin/doary potemkin.utils/doary
40+
41+
potemkin/def-abstract-type clj-kondo.lint-as/def-catch-all
42+
potemkin/reify+ clojure.core/reify
43+
potemkin/defprotocol+ clojure.core/defprotocol
44+
potemkin/deftype+ clojure.core/deftype
45+
potemkin/defrecord+ clojure.core/defrecord
46+
potemkin/definterface+ clojure.core/defprotocol
47+
potemkin/extend-protocol+ clojure.core/extend-protocol
48+
49+
potemkin/reify-map-type clojure.core/reify
50+
potemkin/def-derived-map clj-kondo.lint-as/def-catch-all
51+
potemkin/def-map-type clj-kondo.lint-as/def-catch-all}
52+
53+
;; leave import-vars alone, kondo special-cases it
54+
:hooks {:macroexpand {#_#_potemkin.namespaces/import-vars potemkin.namespaces/import-vars
55+
potemkin.namespaces/import-fn potemkin.namespaces/import-fn
56+
potemkin.namespaces/import-macro potemkin.namespaces/import-macro
57+
potemkin.namespaces/import-def potemkin.namespaces/import-def
58+
59+
#_#_potemkin/import-vars potemkin.namespaces/import-vars
60+
potemkin/import-fn potemkin.namespaces/import-fn
61+
potemkin/import-macro potemkin.namespaces/import-macro
62+
potemkin/import-def potemkin.namespaces/import-def}}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
(ns potemkin.namespaces
2+
(:require [clj-kondo.hooks-api :as api]))
3+
4+
(defn import-macro*
5+
([sym]
6+
`(def ~(-> sym name symbol) ~sym))
7+
([sym name]
8+
`(def ~name ~sym)))
9+
10+
(defmacro import-fn
11+
([sym]
12+
(import-macro* sym))
13+
([sym name]
14+
(import-macro* sym name)))
15+
16+
(defmacro import-macro
17+
([sym]
18+
(import-macro* sym))
19+
([sym name]
20+
(import-macro* sym name)))
21+
22+
(defmacro import-def
23+
([sym]
24+
(import-macro* sym))
25+
([sym name]
26+
(import-macro* sym name)))
27+
28+
#_
29+
(defmacro import-vars
30+
"Imports a list of vars from other namespaces."
31+
[& syms]
32+
(let [unravel (fn unravel [x]
33+
(if (sequential? x)
34+
(->> x
35+
rest
36+
(mapcat unravel)
37+
(map
38+
#(symbol
39+
(str (first x)
40+
(when-let [n (namespace %)]
41+
(str "." n)))
42+
(name %))))
43+
[x]))
44+
syms (mapcat unravel syms)
45+
result `(do
46+
~@(map
47+
(fn [sym]
48+
(let [vr (resolve sym)
49+
m (meta vr)]
50+
(cond
51+
(nil? vr) `(throw (ex-info (format "`%s` does not exist" '~sym) {}))
52+
(:macro m) `(def ~(-> sym name symbol) ~sym)
53+
(:arglists m) `(def ~(-> sym name symbol) ~sym)
54+
:else `(def ~(-> sym name symbol) ~sym))))
55+
syms))]
56+
result))

.clj-kondo/taoensso/encore/config.edn

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{:hooks {:analyze-call {taoensso.encore/defalias taoensso.encore/defalias}}}
1+
{:hooks
2+
{:analyze-call
3+
{taoensso.encore/defalias taoensso.encore/defalias
4+
taoensso.encore/defn-cached taoensso.encore/defn-cached}}}
+31-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
11
(ns taoensso.encore
2+
"I don't personally use clj-kondo, so these hooks are
3+
kindly authored and maintained by contributors.
4+
PRs very welcome! - Peter Taoussanis"
25
(:require
36
[clj-kondo.hooks-api :as hooks]))
47

5-
(defn defalias [{:keys [node]}]
8+
(defn defalias
9+
[{:keys [node]}]
610
(let [[sym-raw src-raw] (rest (:children node))
711
src (if src-raw src-raw sym-raw)
8-
sym (if src-raw
9-
sym-raw
10-
(symbol (name (hooks/sexpr src))))]
11-
{:node (with-meta
12-
(hooks/list-node
13-
[(hooks/token-node 'def)
14-
(hooks/token-node (hooks/sexpr sym))
15-
(hooks/token-node (hooks/sexpr src))])
16-
(meta src))}))
12+
sym
13+
(if src-raw
14+
sym-raw
15+
(symbol (name (hooks/sexpr src))))]
16+
17+
{:node
18+
(with-meta
19+
(hooks/list-node
20+
[(hooks/token-node 'def)
21+
(hooks/token-node (hooks/sexpr sym))
22+
(hooks/token-node (hooks/sexpr src))])
23+
(meta src))}))
24+
25+
(defn defn-cached
26+
[{:keys [node] :as x}]
27+
(let [[sym _opts binding-vec & body] (rest (:children node))]
28+
{:node
29+
(hooks/list-node
30+
(list
31+
(hooks/token-node 'def)
32+
sym
33+
(hooks/list-node
34+
(list*
35+
(hooks/token-node 'fn)
36+
binding-vec
37+
body))))}))

.github/workflows/flyio-deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install clojure cli
3737
uses: DeLaGuardo/setup-clojure@master
3838
with:
39-
cli: 1.11.2.1446
39+
cli: 1.11.3.1463
4040

4141
- name: Cache Maven packages
4242
uses: actions/cache@v4
@@ -64,7 +64,7 @@ jobs:
6464
- name: Install clojure cli
6565
uses: DeLaGuardo/setup-clojure@master
6666
with:
67-
cli: 1.11.2.1446
67+
cli: 1.11.3.1463
6868

6969
- name: Cache Maven packages
7070
uses: actions/cache@v4

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install clojure cli
3434
uses: DeLaGuardo/setup-clojure@master
3535
with:
36-
cli: 1.11.2.1446
36+
cli: 1.11.3.1463
3737

3838
- name: Cache Maven packages
3939
uses: actions/cache@v4
@@ -60,7 +60,7 @@ jobs:
6060
- name: Install clojure cli
6161
uses: DeLaGuardo/setup-clojure@master
6262
with:
63-
cli: 1.11.2.1446
63+
cli: 1.11.3.1463
6464

6565
- name: Setup clojure-lsp
6666
uses: clojure-lsp/setup-clojure-lsp@v1.0.2

deps.edn

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
{:paths ["src" "resources"]
2-
:deps {org.clojure/clojure {:mvn/version "1.11.2"}
3-
com.github.parenthesin/components {:mvn/version "0.2.5"
2+
:deps {org.clojure/clojure {:mvn/version "1.11.3"}
3+
com.github.parenthesin/components {:mvn/version "0.3.0"
44
:exclusions [prismatic/schema]}
5-
com.github.seancorfield/honeysql {:mvn/version "2.6.1126"}
6-
metosin/malli {:mvn/version "0.15.0"}
7-
metosin/reitit-swagger {:mvn/version "0.6.0"}
5+
com.github.seancorfield/honeysql {:mvn/version "2.6.1147"}
6+
metosin/reitit-swagger {:mvn/version "0.7.1"}
87
org.postgresql/postgresql {:mvn/version "42.7.3"}
9-
com.taoensso/encore {:mvn/version "3.97.0"}
10-
datalevin/datalevin {:mvn/version "0.9.3"}
11-
buddy/buddy-sign {:mvn/version "3.5.351"}}
8+
com.taoensso/encore {:mvn/version "3.113.0"}
9+
datalevin/datalevin {:mvn/version "0.9.8"}
10+
buddy/buddy-sign {:mvn/version "3.5.351"}
11+
metosin/malli {:mvn/version "0.16.0"}}
1212
:aliases
1313
{:dev {:extra-paths ["test" "dev" "test/resources"]
1414
:extra-deps {org.clojars.bigsy/pg-embedded-clj {:mvn/version "1.0.1"}
15-
lambdaisland/kaocha {:mvn/version "1.88.1376"}
15+
lambdaisland/kaocha {:mvn/version "1.91.1392"}
1616
lambdaisland/kaocha-cloverage {:mvn/version "1.1.89"}
1717
nubank/matcher-combinators {:mvn/version "3.9.1"}
18-
nubank/state-flow {:mvn/version "5.15.0"}}
18+
nubank/state-flow {:mvn/version "5.17.0"}}
1919
; needed for datalevin on jvm > 11
2020
:jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED"
2121
"--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"]}
2222
:test {:main-opts ["-m" "kaocha.runner"]
2323
:jvm-opts ["-Xms3g" "-Xmx3g"]}
2424

25-
:clojure-lsp {:replace-deps {com.github.clojure-lsp/clojure-lsp-standalone {:mvn/version "2024.03.13-13.11.00"}}
25+
:clojure-lsp {:replace-deps {com.github.clojure-lsp/clojure-lsp-standalone {:mvn/version "2024.04.22-11.50.26"}}
2626
:main-opts ["-m" "clojure-lsp.main"]}
2727

28-
:nrepl {:extra-deps {cider/cider-nrepl {:mvn/version "0.47.1"}}
28+
:nrepl {:extra-deps {cider/cider-nrepl {:mvn/version "0.49.1"}}
2929
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}
3030

3131
:migratus {:main-opts ["-m" "parenthesin.helpers.migrations"]}
3232

33-
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.0"}}
33+
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.4"}}
3434
:ns-default build
3535
:exec-args {:uber-file "target/service.jar"}}}}

0 commit comments

Comments
 (0)