mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-30 14:52:36 +00:00
fix: use uv directly in pre-commit hooks for cross-platform support
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 <joao@crewai.com>
This commit is contained in:
@@ -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 ]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user