-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
98 lines (94 loc) · 2.2 KB
/
Taskfile.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# https://taskfile.dev
version: '3'
vars:
PYTHON: python3.9
env:
FLIT_ROOT_INSTALL: "1"
tasks:
install:base:
status:
- test -f .venvs/base/bin/flitenv
cmds:
- "{{.PYTHON}} -m venv .venvs/base"
- .venvs/base/bin/python3 -m pip install -U flitenv pip-tools
install:test:
sources:
- pyproject.toml
deps:
- install:base
cmds:
- .venvs/base/bin/flitenv test install
install:lint:
sources:
- pyproject.toml
deps:
- install:base
cmds:
- .venvs/base/bin/flitenv lint install
pytest:run:
desc: "run Python tests"
deps:
- install:test
cmds:
- .venvs/base/bin/flitenv test run pytest {{.CLI_ARGS}}
flake8_ruler:run:
desc: "lint Python code"
deps:
- install:lint
cmds:
- .venvs/base/bin/flitenv lint run python3 -m flake8_ruler {{.CLI_ARGS}}
flake8:run:
desc: "lint Python code"
deps:
- install:lint
cmds:
- .venvs/base/bin/flitenv lint run flake8 {{.CLI_ARGS}}
mypy:run:
desc: "check type annotations"
deps:
- install:lint
cmds:
- .venvs/base/bin/flitenv lint run mypy {{.CLI_ARGS}}
yamllint:run:
desc: "lint YAML files"
deps:
- install:lint
cmds:
- .venvs/base/bin/flitenv lint run yamllint {{.CLI_ARGS}} .
bandit:run:
desc: "run security checks for Python code"
deps:
- install:lint
cmds:
- >
.venvs/base/bin/flitenv lint run
bandit {{.CLI_ARGS}} -q -r flake8_ruler
unify:run:
desc: "replace single quotes by double quotes in Python code"
deps:
- install:lint
cmds:
- >
.venvs/base/bin/flitenv lint run unify
-r -i --quote="'"
flake8_ruler tests
isort:run:
desc: "sort imports"
deps:
- install:lint
cmds:
- .venvs/base/bin/flitenv lint run isort {{.CLI_ARGS}} .
isort:check:
desc: "check if all imports are sorted"
deps:
- install:lint
cmds:
- .venvs/base/bin/flitenv lint run isort {{.CLI_ARGS}} --check .
linters:run:
desc: "run all linters"
cmds:
- task: flake8:run
- task: mypy:run
- task: isort:check
- task: yamllint:run
- task: bandit:run