From f2b4429c45a8267ae27117a76d368373bee9ac2b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 23:17:28 +0000 Subject: [PATCH] fix: use uv directly in pre-commit hooks for cross-platform support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4322 The previous pre-commit config used bash-specific commands that don't work on Windows: - bash -c '...' wrapper - source command - Unix-style paths (.venv/bin/activate) This change simplifies the entry commands to use 'uv run' directly, which: - Works on Windows, Linux, and macOS - Automatically handles virtual environment activation - Removes the need for bash-specific syntax Co-Authored-By: João --- .pre-commit-config.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index defe87b5c..417e1d79a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,19 +3,19 @@ repos: hooks: - id: ruff name: ruff - entry: bash -c 'source .venv/bin/activate && uv run ruff check --config pyproject.toml "$@"' -- + entry: uv run ruff check --config pyproject.toml language: system pass_filenames: true types: [python] - id: ruff-format name: ruff-format - entry: bash -c 'source .venv/bin/activate && uv run ruff format --config pyproject.toml "$@"' -- + entry: uv run ruff format --config pyproject.toml language: system pass_filenames: true types: [python] - id: mypy name: mypy - entry: bash -c 'source .venv/bin/activate && uv run mypy --config-file pyproject.toml "$@"' -- + entry: uv run mypy --config-file pyproject.toml language: system pass_filenames: true types: [python] @@ -30,4 +30,3 @@ repos: - id: commitizen - id: commitizen-branch stages: [ pre-push ] -