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 committed Dec 13, 2024
1 parent 5903ce5 commit fddb518
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/guides/integration/pre-commit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
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 fddb518

Please sign in to comment.