Skip to content

Commit bc03cb3

Browse files
omacielclaude
andcommitted
Simplify check-uv-lock pre-commit hook to use uv lock --check
Replace custom bash logic with uv lock --check, which is the authoritative way to verify the lock file is in sync with pyproject.toml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0f96f95 commit bc03cb3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ repos:
3838
- repo: local
3939
hooks:
4040
- id: check-uv-lock
41-
name: check uv.lock is updated when pyproject.toml changes
42-
entry: bash -c 'if git diff --cached --name-only | grep -q "^pyproject.toml$"; then if git diff --cached -- pyproject.toml | grep -qE "^[+-]\s+\"[a-zA-Z]"; then if ! git diff --cached --name-only | grep -q "^uv.lock$"; then echo "Dependencies in pyproject.toml were modified but uv.lock was not. Run \"uv lock\" and stage the changes."; exit 1; fi; fi; fi'
41+
name: check uv.lock is up to date
42+
entry: uv lock --check
4343
language: system
44-
always_run: true
44+
files: pyproject.toml
4545
pass_filenames: false
4646
- repo: local
4747
hooks:

0 commit comments

Comments
 (0)