-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yaml
63 lines (57 loc) · 1.67 KB
/
Taskfile.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
version: '3'
run: once
vars:
YAML:
sh: git ls-files "*.yaml" "*.yml"
SH:
sh: git ls-files "*.sh"
UNIT_TESTS:
sh: git ls-files "tests/first_time_setup/unit/*.sh"
E2E_TESTS:
sh: git ls-files "tests/first_time_setup/e2e/*.sh"
tasks:
uninstall:
desc: Uninstall this library and all of its dependencies.
cmds:
- rm -rf lib
- poetry env remove --all
- pip freeze | grep -v "^-e" | sed "s/@.*//" | xargs pip uninstall -y
install:
desc: Install this library and all of its dependencies.
cmds:
- ./bashdep.sh
- poetry install --no-root --with dev --sync
format:
desc: Format the code using different formatters.
vars:
YAML:
ref: .YAML | splitLines | join " "
SH:
ref: .SH | splitLines | join " "
cmds:
- poetry run codespell --write-changes {{.YAML}} {{.MD}} {{.SH}}
- poetry run mdformat --wrap 79 --number README.md
- poetry run shfmt --write --simplify {{.SH}}
- poetry run pyproject-fmt ./pyproject.toml
lint:
desc: Lint the code using different linters.
vars:
YAML:
ref: .YAML | splitLines | join " "
SH:
ref: .SH | splitLines | join " "
cmds:
- poetry run codespell {{.YAML}} {{.MD}} {{.SH}}
- poetry run yamllint --strict {{.YAML}}
- poetry run mdformat --wrap 79 --number --check README.md
- poetry run shellcheck {{.SH}}
test:
desc: Test the library.
vars:
UNIT_TESTS:
ref: .UNIT_TESTS | splitLines | join " "
E2E_TESTS:
ref: .E2E_TESTS | splitLines | join " "
cmds:
- lib/bashunit --parallel --simple {{.UNIT_TESTS}}
- bash {{.E2E_TESTS}}