-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
executable file
·153 lines (128 loc) · 2.87 KB
/
Copy pathTaskfile.yml
File metadata and controls
executable file
·153 lines (128 loc) · 2.87 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
version: '3'
tasks:
# ======== Environment ========
sync:
desc: Sync dependencies (dev group) using uv
cmds:
- uv sync --all-groups
sync-frozen:
desc: Sync dependencies using locked versions
cmds:
- uv sync --frozen --all-groups
init:
desc: Full project setup
cmds:
- task: sync
- task: precommit
# ======== Pre-commit ========
precommit:
desc: Install git hooks
cmds:
- uv run pre-commit install --install-hooks
precommit-run:
desc: Run pre-commit on all files
cmds:
- uv run pre-commit run --all-files
# ======== Commitizen ========
cz-commit:
desc: Commit using Conventional Commits
cmds:
- uv run cz commit
cz-check:
desc: Check commit messages
cmds:
- uv run cz check
# ======== Formatting ========
fmt:
desc: Auto-fix lint issues and format code
cmds:
- uv run ruff format .
- uv run ruff check . --fix
fmt-unsafe:
desc: Auto-fix lint issues using unsafe fixes and format code
cmds:
- uv run ruff format .
- uv run ruff check . --fix --unsafe-fixes
fmt-check:
desc: Check code formatting
cmds:
- uv run ruff format --check .
# ======== Static analysis ========
ruff:
desc: Run Ruff lint
cmds:
- uv run ruff check .
typecheck:
desc: Run MyPy
cmds:
- uv run mypy .
lint:
desc: Run Ruff and MyPy
cmds:
- task: ruff
- task: fmt-check
- task: typecheck
# ======== Dependency hygiene ========
audit:
desc: Security audit
cmds:
- uv run pip-audit
unused-libs:
desc: Detect unused dependencies
cmds:
- uv run deptry .
# ======== Full quality gate ========
check:
desc: Run full quality checks
cmds:
- task: lint
- task: test-cov
- task: build
- task: audit
- task: unused-libs
ci:
desc: Run CI checks locally
cmds:
- task: lint
- task: test-cov
- task: build
ci-frozen:
desc: Run CI checks with locked dependencies
cmds:
- task: sync-frozen
- task: lint
- task: test-cov
- task: build
# ======== Tests ========
test:
desc: Run tests
cmds:
- uv run pytest
test-cov:
desc: Run tests with coverage
cmds:
- uv run pytest --cov --cov-report=term-missing --cov-report=xml
# ======== Run app ========
run:
desc: Run the application
cmds:
- uv run python -m app.main
# ======== Build ========
build:
desc: Build package (wheel + sdist)
cmds:
- uv build
# ======== Docker ========
docker-build:
desc: Build Docker image
cmds:
- docker build -t python-app .
docker-run:
desc: Run Docker container
cmds:
- docker run -it --rm python-app
docker:
desc: Build and run Docker
cmds:
- task: docker-build
- task: docker-run