From fddb518fb9d7f5dc1ac98f76ea0437ac705f2d16 Mon Sep 17 00:00:00 2001 From: Udi Oron Date: Fri, 13 Dec 2024 18:09:43 +0200 Subject: [PATCH 1/2] docs: added pre-commit uv-lock and uv-export hooks to docs --- docs/guides/integration/pre-commit.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/guides/integration/pre-commit.md b/docs/guides/integration/pre-commit.md index 09a2a13f8b52d..7eb7a7fcfe77c 100644 --- a/docs/guides/integration/pre-commit.md +++ b/docs/guides/integration/pre-commit.md @@ -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" From c2a3ffc315adab6a6bee4951d7ea7fd6d5dcc1b2 Mon Sep 17 00:00:00 2001 From: Udi Oron Date: Mon, 16 Dec 2024 21:35:16 +0200 Subject: [PATCH 2/2] Update docs/guides/integration/pre-commit.md Co-authored-by: Jonne --- docs/guides/integration/pre-commit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/integration/pre-commit.md b/docs/guides/integration/pre-commit.md index 7eb7a7fcfe77c..25e8877b6f83c 100644 --- a/docs/guides/integration/pre-commit.md +++ b/docs/guides/integration/pre-commit.md @@ -3,7 +3,7 @@ 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 +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`: ```yaml title=".pre-commit-config.yaml"