diff --git a/docs/guides/integration/pre-commit.md b/docs/guides/integration/pre-commit.md index fd1e4a48a..30d5c9aaa 100644 --- a/docs/guides/integration/pre-commit.md +++ b/docs/guides/integration/pre-commit.md @@ -10,8 +10,10 @@ description: 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 `pyproject.toml` file was changed via -pre-commit, add the following to the `.pre-commit-config.yaml`: +To use uv with pre-commit, add one of the following examples to the `repos` list in the +`.pre-commit-config.yaml`. + +To make sure your `uv.lock` file is up to date even if your `pyproject.toml` file was changed: ```yaml title=".pre-commit-config.yaml" repos: @@ -22,7 +24,7 @@ repos: - id: uv-lock ``` -To keep your `requirements.txt` file updated using pre-commit: +To keep a `requirements.txt` file in sync with your `uv.lock` file: ```yaml title=".pre-commit-config.yaml" repos: @@ -33,7 +35,7 @@ repos: - id: uv-export ``` -To compile requirements via pre-commit, add the following to the `.pre-commit-config.yaml`: +To compile requirements files: ```yaml title=".pre-commit-config.yaml" repos: @@ -46,7 +48,7 @@ repos: args: [requirements.in, -o, requirements.txt] ``` -To compile alternative files, modify `args` and `files`: +To compile alternative requirements files, modify `args` and `files`: ```yaml title=".pre-commit-config.yaml" repos: @@ -60,7 +62,7 @@ repos: files: ^requirements-dev\.(in|txt)$ ``` -To run the hook over multiple files at the same time: +To run the hook over multiple files at the same time, add additional entries: ```yaml title=".pre-commit-config.yaml" repos: