uv add --dev pre-commit
uv run pre-commit install
touch .pre-commit-config.yaml
here is a pre-commit conf example which use Ruff and Shellcheck linters (python and bash):
repos:
- repo: local
hooks:
- id: ruff-format-diff
name: ruff format diff
language: system
entry: uv run ruff format --diff
types: [python]
- id: ruff-check
name: ruff check
language: system
entry: uv run ruff check
- id: shellcheck
name: run shellcheck
language: system
entry: shellcheck
files: .(sh.j2|sh)$
At each git commit attempt, linters will check commited code and validate or not the commit
uv add --dev pre-commituv run pre-commit installtouch .pre-commit-config.yamlhere is a pre-commit conf example which use Ruff and Shellcheck linters (python and bash):
repos:
- repo: local
hooks:
- id: ruff-format-diff
name: ruff format diff
language: system
entry: uv run ruff format --diff
types: [python]
- id: ruff-check
name: ruff check
language: system
entry: uv run ruff check
- id: shellcheck
name: run shellcheck
language: system
entry: shellcheck
files: .(sh.j2|sh)$
At each
git commitattempt, linters will check commited code and validate or not the commit