chore: add pre-commit hook to auto-update lockfile on pyproject.toml changes
This commit is contained in:
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if git diff --cached --name-only | grep -q "^pyproject\.toml$"; then
|
||||
uv lock
|
||||
git add uv.lock
|
||||
fi
|
||||
@@ -17,8 +17,11 @@ git clone https://github.com/sudolulo/winnow.git
|
||||
cd winnow
|
||||
git checkout dev
|
||||
uv sync
|
||||
git config core.hooksPath .githooks
|
||||
```
|
||||
|
||||
The last line activates the project's git hooks. The pre-commit hook automatically runs `uv lock` and stages the result whenever `pyproject.toml` is part of a commit, keeping the lockfile in sync without any extra steps.
|
||||
|
||||
## Running Tests and Lint
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user