nl2sql-copilot / .pre-commit-config.yaml
Melika Kheirieh
chore(pre-commit): add types-PyYAML to mypy additional_dependencies; clean & rewire hooks
a578b12
raw
history blame
1.74 kB
# Run auto-fix hooks only on commit; run heavy checks (mypy, pytest) on push.
default_stages: [pre-commit]
repos:
# --- Basic hygiene checks (auto-fix) β€” commit only ---
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-merge-conflict # sanity check only
- id: end-of-file-fixer # ensures newline at EOF
stages: [pre-commit]
- id: trailing-whitespace # removes trailing spaces
stages: [pre-commit]
# --- Ruff: linting and formatting (auto-fix) β€” commit only ---
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.3
hooks:
- id: ruff
# Allow auto-fix; do not fail if fixes are applied.
args: [--fix]
stages: [pre-commit]
- id: ruff-format
stages: [pre-commit]
# --- Mypy: type-checking β€” push only (no edits) ---
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
# Run on the entire repo at push time (not just changed files)
pass_filenames: false
args:
- .
- --ignore-missing-imports
- --explicit-package-bases
additional_dependencies:
- types-requests>=2.32.0.20241016
- types-PyYAML>=6.0.12.20240808
stages: [pre-push]
# --- Pytest: run test suite β€” push only (no edits) ---
- repo: local
hooks:
- id: pytest-on-push
name: pytest (pre-push)
# If Makefile is present, keep this entry; otherwise use:
# entry: bash -lc 'PYTHONPATH=$PWD pytest -q -m "not slow"'
entry: make test
language: system
pass_filenames: false
stages: [pre-push]