File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
resources/clj-kondo.exports/io.github.hlship/cli-tools/cli_tools Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ The `abort` function assumes an exit status of 1 if the first message passed is
6
6
It also now prints the tool and command name in bold green (to be conistent with
7
7
the rest of the library).
8
8
9
+ The clj-kondo hook for the ` defcommand ` now produces slightly different code, that defeats
10
+ the clj-kondo static type analysis, preventing spurious warnings about vectors passed
11
+ to particular clojure.core functions.
12
+
9
13
Dependencies were not properly declared for Clojure applications that use cli-tools
10
14
(libraries that are bundled with Babashka were omitted).
11
15
Original file line number Diff line number Diff line change 34
34
(next more-terms)
35
35
(update blocks :opts conj term (first more-terms)))))))
36
36
37
+ (defn xform-opts
38
+ " This is a lot of work to actually defeat clj-kondo's normal static analysis.
39
+
40
+ See https://github.com/hlship/cli-tools/issues/28 for more info."
41
+ [opts]
42
+ (when (seq opts)
43
+ (let [pairs (partition 2 opts)
44
+ collector (api/token-node (gensym " options" ))
45
+ map-terms (mapcat (fn [[sym v]]
46
+ [(api/keyword-node (-> sym str keyword)) v])
47
+ pairs)]
48
+ [collector
49
+ (api/map-node (vec map-terms))
50
+
51
+ (api/map-node [(api/keyword-node :keys )
52
+ (api/vector-node (map first pairs))])
53
+ collector])))
37
54
38
55
(defn- parse-interface
39
56
[interface]
45
62
vector (api/vector-node
46
63
(concat
47
64
lets
48
- opts
65
+ ( xform- opts opts)
49
66
afters))]
50
67
vector))
51
68
You can’t perform that action at this time.
0 commit comments