astral-sh / astral-sh/uv-pre-commit

Add `uv-sync-check` and `uv-lock-check` hooks

Open Beginner friendly
#75 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
348
Forks
27
PR merge metrics
No merged PRs in 30d

Description

## Summary

Please add dedicated `uv-sync-check` and `uv-lock-check` hooks alongside the existing hooks.
- `uv-sync-check` would run `uv sync --check`, failing when the project environment is not synchronized.
- `uv-lock-check` would run `uv lock --check`, failing when `uv.lock` is missing or would change after resolution.

These would provide explicit validation-only hooks while keeping the existing `uv-sync` and `uv-lock` behavior unchanged.
- `uv-sync-check` should run as a normal pre-commit validation hook rather than being limited to the post-checkout, post-merge, and post-rewrite stages used by `uv-sync`.

## Usage

```yaml
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.12.12
hooks:
- id: uv-sync-check
- id: uv-lock-check
```

## References

- [`uv sync --check`](https://docs.astral.sh/uv/reference/cli/#uv-sync--check)
- [`uv lock --check`](https://docs.astral.sh/uv/reference/cli/#uv-lock--check)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing `uv-sync` and `uv-lock` hooks and their stage configuration. Add validation-only `uv-sync-check` and `uv-lock-check` hooks using the referenced commands, keep the existing hooks unchanged, and verify that `uv-sync-check` runs as a normal pre-commit hook.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.