-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbb.edn
30 lines (30 loc) · 1.05 KB
/
bb.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{:paths ["tasks" "test"]
:min-bb-version "0.4.0"
:tasks
{:requires ([babashka.fs :as fs]
[server :as s]
[tasks :as t])
docs t/docs
lint (shell "clj-kondo" "--lint" ".")
-nrepl-port (or (System/getenv "NREPL_PORT")
"54601")
nrepl {:doc "Start nrepl server for editor integration"
:depends [-nrepl-port]
:task
(do
(spit ".nrepl-port" -nrepl-port)
(try
(shell "bb" "--nrepl-server" -nrepl-port)
(finally
(fs/delete ".nrepl-port"))))}
; Check for changes so pre-commit will abort and changes can be added.
pre-commit {:depends [docs lint style:check]
:doc "A git pre-commit hook to check docs, style, etc"
:task (shell "git" "diff" "--exit-code" "README.md")}
server s/run
style:check (shell "cljstyle" "check")
style:fix (shell "cljstyle" "fix")
test {:doc "Run test suite with fake http server"
:task (do
(s/start)
(t/test *command-line-args*))}}}