[#825] Handle uneval-ed expressions in bb tasks
This commit is contained in:
parent
69ee221eda
commit
9a8bf7d0c3
2 changed files with 23 additions and 4 deletions
|
|
@ -360,10 +360,14 @@
|
||||||
loc (zip/find-value loc :tasks)
|
loc (zip/find-value loc :tasks)
|
||||||
loc (zip/right loc)
|
loc (zip/right loc)
|
||||||
loc (zip/down loc)]
|
loc (zip/down loc)]
|
||||||
(filter symbol?
|
(->>
|
||||||
(map zip/sexpr
|
loc
|
||||||
(take-while #(not (zip/end? %))
|
(iterate zip/right)
|
||||||
(take-nth 2 (iterate zip/right loc)))))))
|
(take-nth 2 )
|
||||||
|
(take-while #(not (zip/end? %)))
|
||||||
|
(filter zip/sexpr-able?)
|
||||||
|
(map zip/sexpr)
|
||||||
|
(filter symbol?))))
|
||||||
|
|
||||||
(defn list-tasks
|
(defn list-tasks
|
||||||
[sci-ctx]
|
[sci-ctx]
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,18 @@
|
||||||
{'foo {:depends ['bar 'quux]}
|
{'foo {:depends ['bar 'quux]}
|
||||||
'bar {:depends ['quux]}}
|
'bar {:depends ['quux]}}
|
||||||
'foo))))
|
'foo))))
|
||||||
|
|
||||||
|
(t/deftest key-order-test
|
||||||
|
(let [edn "{:tasks
|
||||||
|
{;; Development tasks
|
||||||
|
repl {:doc \"Starts an nrepl session with a reveal window\"
|
||||||
|
:task (clojure \"-M:reveal-nrepl\")}
|
||||||
|
|
||||||
|
;; Testing
|
||||||
|
watch-tests {:doc \"Watch tests and run on change\"
|
||||||
|
:task (clojure \"-M:test -m kaocha.runner --watch\")}
|
||||||
|
;test
|
||||||
|
#_{:doc \"Runs tests\"
|
||||||
|
:task (clojure \"-M:test -m kaocha.runner\")}
|
||||||
|
}}"]
|
||||||
|
(t/is (= '[repl watch-tests] (sut/key-order edn)))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue