-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
36 lines (28 loc) · 1.01 KB
/
justfile
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
31
32
33
34
35
36
# list commands
default:
just --list
# run tests with kaocha
test:
bin/kaocha --no-watch
# watch files and run tests continuously
watch:
bin/kaocha --watch
# run clj-kondo to lint files under src/
lint:
clj -M:clj-kondo --lint src --parallel
# format code with cljfmt
format:
clj -M:cljfmt
# create files for new problem set
create prob_num: (_create_src prob_num) (_create_test prob_num)
@echo 'Created src/ex/q{{prob_num}}.clj and test/ex/q{{prob_num}}_test.clj'
_create_src num:
@echo ";; https://4clojure.oxal.org/#/problem/{{num}}" > 'src/ex/q{{num}}.clj'
@echo ' ' >> 'src/ex/q{{num}}.clj'
@echo '(ns ex.q{{num}})' >> 'src/ex/q{{num}}.clj'
_create_test num:
@echo ";; https://4clojure.oxal.org/#/problem/{{num}}" > 'test/ex/q{{num}}_test.clj'
@echo ' ' >> 'test/ex/q{{num}}_test.clj'
@echo '(ns ex.q{{num}}-test' >> 'test/ex/q{{num}}_test.clj'
@echo ' (:require [clojure.test :as t]' >> 'test/ex/q{{num}}_test.clj'
@echo ' [ex.q{{num}} :as sut]))' >> 'test/ex/q{{num}}_test.clj'