[#825] Handle uneval-ed expressions in bb tasks

This commit is contained in:
Michiel Borkent 2021-05-08 11:01:32 +02:00
parent 69ee221eda
commit 9a8bf7d0c3
2 changed files with 23 additions and 4 deletions

View file

@ -360,10 +360,14 @@
loc (zip/find-value loc :tasks)
loc (zip/right loc)
loc (zip/down loc)]
(filter symbol?
(map zip/sexpr
(take-while #(not (zip/end? %))
(take-nth 2 (iterate zip/right loc)))))))
(->>
loc
(iterate zip/right)
(take-nth 2 )
(take-while #(not (zip/end? %)))
(filter zip/sexpr-able?)
(map zip/sexpr)
(filter symbol?))))
(defn list-tasks
[sci-ctx]

View file

@ -8,3 +8,18 @@
{'foo {:depends ['bar 'quux]}
'bar {:depends ['quux]}}
'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)))))