You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+82-4Lines changed: 82 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -243,16 +243,94 @@ Pull requests should include tests + documentation updates.
243
243
244
244
---
245
245
246
-
## Makefile Overview
246
+
## 🪝 Pre-commit Hooks
247
247
248
-
The Makefile provides**unified commands** for backend, frontend, Docker, DB, and environment management.
248
+
This repository uses**[pre-commit](https://pre-commit.com/)**to enforce consistent code quality checks for both the **backend (Python)** and **frontend (TypeScript)**.
249
249
250
-
View all available commands:
250
+
Pre-commit runs automatically on `git commit` and will block commits if checks fail.
251
+
252
+
---
253
+
254
+
### What pre-commit checks
255
+
256
+
-**Backend**
257
+
- Ruff linting and formatting
258
+
- Python style and correctness checks
259
+
-**Frontend**
260
+
- ESLint (auto-fix on staged files)
261
+
- Prettier formatting (staged files only)
262
+
263
+
All hooks are configured in the root `.pre-commit-config.yaml`.
264
+
265
+
> **Note:** Git hooks run in a non-interactive shell
266
+
> Make sure that Node.js tools (such as `pnpm`) are available in your system `PATH` so pre-commit hooks can execute successfully.
267
+
268
+
---
269
+
270
+
### Installing pre-commit (recommended)
271
+
272
+
Pre-commit is installed **inside the backend uv environment** and wired up via the Makefile.
273
+
274
+
After cloning the repo, run:
251
275
252
276
```bash
253
-
make help
277
+
make install
254
278
```
255
279
280
+
This will:
281
+
282
+
- Create the backend `uv` virtual environment (if missing)
283
+
- Install Python and frontend dependencies
284
+
- Install the git pre-commit hooks
285
+
286
+
If you only want to (re)install the hooks:
287
+
288
+
```bash
289
+
make pre-commit-install
290
+
```
291
+
292
+
---
293
+
294
+
### Running pre-commit manually
295
+
296
+
To run all hooks against all files:
297
+
298
+
```bash
299
+
make pre-commit-run
300
+
```
301
+
302
+
Or directly:
303
+
304
+
```bash
305
+
cd backend
306
+
uv run pre-commit run --all-files
307
+
```
308
+
309
+
You can also run pre-commit from **any directory inside the repo**; it always resolves the repo root configuration.
310
+
311
+
---
312
+
313
+
### Notes & expectations
314
+
315
+
- Pre-commit uses the **existing project environments**:
316
+
- Python hooks run via `uv`
317
+
- Frontend hooks run via `pnpm`
318
+
- The tools themselves (`uv`, `pnpm`, `node`) are expected to already be installed on your system
319
+
- Hooks are **fast** and only run on staged files by default
320
+
- Formatting issues are usually auto-fixed; re-stage files and retry the commit if needed
0 commit comments