Files
crewAI/.pre-commit-config.yaml
Devin AI f2b4429c45 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>
2026-01-31 23:17:28 +00:00

33 lines
950 B
YAML

repos:
- repo: local
hooks:
- id: ruff
name: ruff
entry: uv run ruff check --config pyproject.toml
language: system
pass_filenames: true
types: [python]
- id: ruff-format
name: ruff-format
entry: uv run ruff format --config pyproject.toml
language: system
pass_filenames: true
types: [python]
- id: mypy
name: mypy
entry: uv run mypy --config-file pyproject.toml
language: system
pass_filenames: true
types: [python]
exclude: ^(lib/crewai/src/crewai/cli/templates/|lib/crewai/tests/|lib/crewai-tools/tests/|lib/crewai-files/tests/)
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.3
hooks:
- id: uv-lock
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.10.1
hooks:
- id: commitizen
- id: commitizen-branch
stages: [ pre-push ]