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

Request: hook to detect unnecessary `uv.lock` changes

Open
#40 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

I often observe PRs with minor changes to application code or unit tests, but no changes to dependencies, and a `uv.lock` change is pushed. This `uv.lock` change is unnecessary, and pollutes the Git history for this `uv.lock`.

How do we feel about adding a `pre-commit` hook or GitHub Action to detect `uv.lock` changes?

I define an unnecessary `uv.lock` change as something like (I know this isn't exact, but you get the idea):

```bash
# Previously, uv.lock has changes on the Git branch `feature`
git checkout feature
git checkout main -- uv.lock
uv lock
if git diff main -- uv.lock; then
echo "uv.lock change should be reverted."
fi
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the proposed uv.lock comparison command and the repository's existing pre-commit or GitHub Actions configuration, if present. Done means detecting an unnecessary uv.lock change and reporting that it should be reverted, but the issue does not specify which integration or exact comparison behavior to use.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.