mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-17 19:31:34 +00:00
71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
# Configuration for pre-commit hooks (see https://pre-commit.com/).
|
|
# Eventually the hooks described here will be run as tests before merging each PR.
|
|
|
|
exclude: ^(core/dbt/docs/build/|core/dbt/common/events/types_pb2.py|core/dbt/events/core_types_pb2.py|core/dbt/adapters/events/adapter_types_pb2.py)
|
|
|
|
# Force all unspecified python hooks to run python 3.8
|
|
default_language_version:
|
|
python: python3
|
|
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v3.2.0
|
|
hooks:
|
|
- id: check-yaml
|
|
args: [--unsafe]
|
|
- id: check-json
|
|
- id: end-of-file-fixer
|
|
- id: trailing-whitespace
|
|
exclude_types:
|
|
- "markdown"
|
|
- id: check-case-conflict
|
|
- repo: https://github.com/pycqa/isort
|
|
# rev must match what's in dev-requirements.txt
|
|
rev: 5.13.2
|
|
hooks:
|
|
- id: isort
|
|
- repo: https://github.com/psf/black
|
|
# rev must match what's in dev-requirements.txt
|
|
rev: 24.3.0
|
|
hooks:
|
|
- id: black
|
|
- id: black
|
|
alias: black-check
|
|
stages: [manual]
|
|
args:
|
|
- "--check"
|
|
- "--diff"
|
|
- repo: https://github.com/pycqa/flake8
|
|
# rev must match what's in dev-requirements.txt
|
|
rev: 4.0.1
|
|
hooks:
|
|
- id: flake8
|
|
- id: flake8
|
|
alias: flake8-check
|
|
stages: [manual]
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
# rev must match what's in dev-requirements.txt
|
|
rev: v1.4.1
|
|
hooks:
|
|
- id: mypy
|
|
# N.B.: Mypy is... a bit fragile.
|
|
#
|
|
# By using `language: system` we run this hook in the local
|
|
# environment instead of a pre-commit isolated one. This is needed
|
|
# to ensure mypy correctly parses the project.
|
|
|
|
# It may cause trouble
|
|
# in that it adds environmental variables out of our control to the
|
|
# mix. Unfortunately, there's nothing we can do about per pre-commit's
|
|
# author.
|
|
# See https://github.com/pre-commit/pre-commit/issues/730 for details.
|
|
args: [--show-error-codes]
|
|
files: ^core/dbt/
|
|
language: system
|
|
- id: mypy
|
|
alias: mypy-check
|
|
stages: [manual]
|
|
args: [--show-error-codes, --pretty]
|
|
files: ^core/dbt/
|
|
language: system
|