-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
235 lines (197 loc) · 8.1 KB
/
Copy pathTaskfile.yml
File metadata and controls
235 lines (197 loc) · 8.1 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# Taskfile.yml — sumd (Structured Unified Markdown Descriptor) project runner
# https://taskfile.dev
version: "3"
vars:
APP_NAME: sumd
DOQL_OUTPUT: app.doql.less
DOQL_CMD: "{{if eq OS \"windows\"}}doql.exe{{else}}doql{{end}}"
VENV_PY: "{{.PWD}}/.venv/bin/python"
VENV_PIP: "{{.PWD}}/.venv/bin/pip"
env:
PYTHONPATH: "{{.PWD}}"
tasks:
# ─────────────────────────────────────────────────────────────────────────────
# Development
# ─────────────────────────────────────────────────────────────────────────────
install:
desc: Install Python dependencies (editable)
cmds:
- "{{.VENV_PIP}} install -e .[dev]"
deps:update:
desc: Upgrade all outdated Python packages in the project venv
cmds:
- |
PIP="{{.VENV_PIP}}"
$PIP install --upgrade pip
OUTDATED=$($PIP list --outdated --format=columns 2>/dev/null | tail -n +3 | awk '{print $1}')
if [ -z "$OUTDATED" ]; then
echo "✅ All packages are up to date."
else
echo "📦 Upgrading: $OUTDATED"
echo "$OUTDATED" | xargs $PIP install --upgrade
echo "✅ Done."
fi
quality:
desc: Run pyqual quality pipeline (uses pyqual.yaml from cwd)
cmds:
- "{{.VENV_PY}} -m pyqual run"
quality:fix:
desc: Run pyqual with auto-fix (uses pyqual.yaml from cwd)
cmds:
- "{{.VENV_PY}} -m pyqual run --fix"
quality:report:
desc: Generate pyqual quality report (uses pyqual.yaml from cwd)
cmds:
- "{{.VENV_PY}} -m pyqual report"
test:
desc: Run pytest suite
cmds:
- "{{.VENV_PY}} -m pytest -q"
test:report:
desc: Run pytest suite and generate HTML report
cmds:
- "{{.VENV_PY}} -m pytest --json-report --json-report-file=test-results.json -q"
- "{{.VENV_PY}} -m testql report test-results.json -o report.html"
test:report:example:
desc: Generate example testql HTML report
cmds:
- "{{.VENV_PY}} -m testql report --example -o report.html"
lint:
desc: Run ruff lint check
cmds:
- ruff check .
fmt:
desc: Auto-format with ruff
cmds:
- ruff format .
build:
desc: Build wheel + sdist
cmds:
- "{{.VENV_PY}} -m build"
clean:
desc: Remove build artefacts
cmds:
- rm -rf build/ dist/ *.egg-info
all:
desc: Run install, quality check
cmds:
- task: install
- task: quality
# ─────────────────────────────────────────────────────────────────────────────
# Doql Integration
# ─────────────────────────────────────────────────────────────────────────────
structure:
desc: Generate project structure (app.doql.less)
cmds:
- |
echo "📁 Analyzing sumd project structure..."
{{.DOQL_CMD}} adopt {{.PWD}} --output app.doql.less --force
echo "✅ Structure generated: {{.DOQL_OUTPUT}}"
doql:adopt:
desc: Reverse-engineer sumd project structure (LESS format)
cmds:
- "{{.DOQL_CMD}} adopt {{.PWD}} --output app.doql.less --force"
- echo "✅ Captured in app.doql.less"
doql:export:
desc: Export app.doql.less to other formats
cmds:
- |
if [ ! -f "app.doql.less" ]; then
echo "❌ app.doql.less not found. Run: task structure"
exit 1
fi
- "{{.DOQL_CMD}} export --format less -o {{.DOQL_OUTPUT}}"
- echo "✅ Exported to {{.DOQL_OUTPUT}}"
doql:validate:
desc: Validate app.doql.less syntax
cmds:
- |
if [ ! -f "{{.DOQL_OUTPUT}}" ]; then
echo "❌ {{.DOQL_OUTPUT}} not found. Run: task structure"
exit 1
fi
- "{{.DOQL_CMD}} validate"
doql:doctor:
desc: Run doql health checks
cmds:
- "{{.DOQL_CMD}} doctor"
doql:build:
desc: Generate code from app.doql.less
cmds:
- |
if [ ! -f "{{.DOQL_OUTPUT}}" ]; then
echo "❌ {{.DOQL_OUTPUT}} not found. Run: task structure"
exit 1
fi
- "{{.DOQL_CMD}} build app.doql.less --out build/"
analyze:
desc: Full doql analysis (structure + validate + doctor)
cmds:
- task: structure
- task: doql:validate
- task: doql:doctor
# ─────────────────────────────────────────────────────────────────────────────
# Documentation
# ─────────────────────────────────────────────────────────────────────────────
docs:build:
desc: Build documentation
cmds:
- echo "Building SUMD documentation..."
- "{{.VENV_PY}} -m sumd.cli docs/ docs/"
# ─────────────────────────────────────────────────────────────────────────────
# SUMD Documentation Generation
# ─────────────────────────────────────────────────────────────────────────────
sumd:
desc: Generate SUMD.md (full project documentation)
cmds:
- "{{.VENV_PY}} -m sumd.cli scan ."
sumr:
desc: Generate SUMR.md (pre-refactoring analysis report)
cmds:
- "{{.VENV_PY}} -m sumd.cli scan . --profile refactor"
# ─────────────────────────────────────────────────────────────────────────────
# Release
# ─────────────────────────────────────────────────────────────────────────────
version:bump:
desc: Bump patch version (hatch)
cmds:
- hatch version patch
- echo "✅ Version bumped:"
- hatch version
publish:
desc: Build and publish to PyPI
cmds:
- task: clean
- task: build
- "{{.VENV_PY}} -m twine upload dist/*"
# ─────────────────────────────────────────────────────────────────────────────
# Utility
# ─────────────────────────────────────────────────────────────────────────────
check:
desc: Full pre-commit check (lint + test + quality)
cmds:
- task: lint
- task: test
- task: quality
doctor:
desc: Smoke-test all external CLI tools used by this project
cmds:
- |
echo "=== sumd doctor ==="
check() { "$@" > /dev/null 2>&1 && echo " ✅ $1" || echo " ❌ $1 (command failed: $*)"; }
check {{.VENV_PY}} -m pyqual doctor
check {{.VENV_PY}} -m pytest --version
check ruff --version
check {{.PWD}}/.venv/bin/sumd --version
check {{.PWD}}/.venv/bin/sumd --help
echo "=== done ==="
help:
desc: Show available tasks
cmds:
- task --list
all:
desc: Install, full check, generate SUMD docs
cmds:
- task: install
- task: check
- task: sumd