-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
115 lines (97 loc) · 2.55 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: "3"
set:
- errexit
- nounset
- pipefail
dotenv:
- .env
tasks:
desc: Init, format, and lint.
default:
cmds:
- task: init
- task: format
- task: lint
- task: test
init:
desc: Initialize environment.
cmds:
- task: init-precommit
- task: init-uv
init-precommit:
desc: Initialize pre-commit.
cmds:
- pre-commit install --install-hooks
- pre-commit install --install-hooks --hook-type commit-msg
- pre-commit install --install-hooks --hook-type post-checkout
- pre-commit install --install-hooks --hook-type post-merge
init-uv:
desc: Initialize uv.
cmds:
- uv sync --locked --all-extras --dev
update:
desc: Update dependencies.
cmds:
- task: update-precommit
- task: update-uv
update-precommit:
desc: Update pre-commit dependencies.
cmds:
- pre-commit autoupdate
update-uv:
desc: Update uv dependencies.
cmds:
- uv sync --upgrade --all-extras --dev
format:
desc: Run formatters.
cmds:
- task: format-precommit
- task: format-ruff
format-precommit:
desc: Run pre-commit hooks that format.
cmds:
- >-
SKIP="$(uv run scripts/filter_pre_commit_hooks.py --mode=tag format)"
&& export SKIP
&& (pre-commit run --all-files || pre-commit run --all-files)
| grep --perl-regexp --invert-match --regexp='\.\e.+Skipped'
format-ruff:
desc: Run Ruff formatter and checker (fix).
cmds:
- uv run ruff format
- uv run ruff check --fix-only --unsafe-fixes
lint:
desc: Run linters.
cmds:
- task: lint-precommit
- task: lint-ruff
- task: lint-mypy
lint-precommit:
desc: Run pre-commit hooks that lint.
cmds:
- >-
SKIP="$(uv run scripts/filter_pre_commit_hooks.py --mode=tag lint)"
&& export SKIP
&& pre-commit run --all-files
| grep --perl-regexp --invert-match --regexp='\.\e.+Skipped'
lint-ruff:
desc: Run Ruff checker (nofix).
cmds:
- uv run ruff check --no-fix
lint-mypy:
desc: Run mypy.
cmds:
- uv run dmypy run --timeout 3600 src tests
test:
desc: Run tests.
cmds:
- uv run pytest
create-notes:
desc: Create notes for latest release.
cmds:
- mkdir -p tmp
- >-
awk '/^## /{count++} count==2{print} count==3{exit}' CHANGELOG.md
| tail +2 | awk 'NF {p=1} p' | tac | awk 'NF {p=1} p' | tac
| sed 's/^### /## /' > tmp/release.md
- uvx mdformat --wrap=10000 tmp/release.md