Skip to content

Commit 3938901

Browse files
committed
add condo configs
1 parent 6753a33 commit 3938901

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{:hooks
2+
{:analyze-call
3+
{taoensso.encore/defalias taoensso.encore/defalias
4+
taoensso.encore/defn-cached taoensso.encore/defn-cached}}}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
(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"
5+
(:require
6+
[clj-kondo.hooks-api :as hooks]))
7+
8+
(defn defalias
9+
[{:keys [node]}]
10+
(let [[sym-raw src-raw] (rest (:children node))
11+
src (if src-raw src-raw sym-raw)
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))))}))

0 commit comments

Comments
 (0)