Skip to content

Commit

Permalink
docs: added pre-commit uv-lock and uv-export hooks to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nonZero authored Dec 13, 2024
1 parent 5903ce5 commit 4b7838a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/guides/integration/pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
An official pre-commit hook is provided at
[`astral-sh/uv-pre-commit`](https://github.com/astral-sh/uv-pre-commit).

To make sure your `uv.lock` file is up to date even if your `pyporject.toml` file was changed via pre-commit, add the following to the `.pre-commit-config.yaml`:

```yaml title=".pre-commit-config.yaml"
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.5.8
hooks:
- id: uv-lock
```
To keep your `requirements.txt` file updated using pre-commit:

```yaml title=".pre-commit-config.yaml"
- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.5.8
hooks:
- id: uv-export
```

To compile requirements via pre-commit, add the following to the `.pre-commit-config.yaml`:

```yaml title=".pre-commit-config.yaml"
Expand Down

0 comments on commit 4b7838a

Please sign in to comment.