Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
executable file
·183 lines (152 loc) · 3.59 KB
/
Copy pathTaskfile.yml
File metadata and controls
executable file
·183 lines (152 loc) · 3.59 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
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
# ======== Alembic ========
alembic-revision:
desc: Create new Alembic migration
cmds:
- uv run alembic revision --autogenerate -m "{{.CLI_ARGS}}"
alembic-upgrade:
desc: Apply Alembic migrations
cmds:
- uv run alembic upgrade head
alembic-downgrade:
desc: Downgrade Alembic migration by one revision
cmds:
- uv run alembic downgrade -1
alembic-current:
desc: Show current Alembic revision
cmds:
- uv run alembic current
alembic-history:
desc: Show Alembic migration history
cmds:
- uv run alembic history
alembic-heads:
desc: Show Alembic heads
cmds:
- uv run alembic heads
# ======== Run app ========
run:
desc: Run the application
cmds:
- uv run uvicorn ai_notes_api.main:app --reload --app-dir src
run-celery:
desc: Run the Celery
cmds:
- uv run celery -A ai_notes_api.workers.celery_app.celery_app worker --loglevel=info
# ======== Build ========
build:
desc: Build package (wheel + sdist)
cmds:
- uv build
# ======== Docker ========
docker:
desc: Build and run Docker
cmds:
- docker compose up --build -d
docker-down:
desc: Stop Docker services
cmds:
- docker compose down