chore: use uv run in pre-commit

This commit is contained in:
Stijnvandenbroek
2026-03-04 10:26:08 +00:00
parent f7d5cb06f9
commit 87d3e9ed20

View File

@@ -1,35 +1,39 @@
repos: repos:
# ── Python: ruff (lint + format) ───────────────────────────────────────── # ── Local hooks (use uv-managed tool versions from uv.lock) ──────────────
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: local
rev: v0.9.9
hooks: hooks:
- id: ruff - id: ruff-lint
args: [--fix] name: ruff lint
- id: ruff-format entry: uv run ruff check --fix
language: system
types: [python]
- id: ruff-format
name: ruff format
entry: uv run ruff format
language: system
types: [python]
- id: sqlfluff-lint
name: sqlfluff lint
entry: uv run sqlfluff lint --dialect postgres
language: system
types: [sql]
files: ^dbt/models/
# ── YAML / JSON / Markdown: prettier ─────────────────────────────────────
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier - id: prettier
types_or: [yaml, json, markdown] name: prettier
entry: npx --yes prettier --write
language: system
types_or: [yaml, markdown]
exclude: | exclude: |
(?x)^( (?x)^(
dbt/target/| dbt/target/|
dbt/dbt_packages/| dbt/dbt_packages/|
\.venv/ \.venv/|
\.pytest_cache/
) )
# ── SQL: sqlfluff ─────────────────────────────────────────────────────────
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.4.0
hooks:
- id: sqlfluff-lint
additional_dependencies: [sqlfluff-templater-dbt, dbt-core, dbt-postgres]
- id: sqlfluff-fix
additional_dependencies: [sqlfluff-templater-dbt, dbt-core, dbt-postgres]
stages: [manual] # only run sqlfluff-fix manually (make lint-fix)
# ── General hygiene ─────────────────────────────────────────────────────── # ── General hygiene ───────────────────────────────────────────────────────
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 rev: v5.0.0