-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
83 lines (76 loc) · 2.8 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
83 lines (76 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
fail_fast: false
default_stages: [pre-commit]
repos:
# ============================================================================
# General checks
# ============================================================================
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
stages: [pre-commit, manual]
- id: end-of-file-fixer
stages: [pre-commit, manual]
- id: check-yaml
stages: [pre-commit, manual]
- id: check-added-large-files
stages: [pre-commit, manual]
- id: check-docstring-first
files: \.py$
stages: [pre-commit, manual]
- id: check-merge-conflict
stages: [pre-commit, manual]
- id: check-case-conflict
stages: [pre-commit, manual]
# ============================================================================
# Ruff - Modern Python linter and formatter
# ============================================================================
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.1
hooks:
# Ruff linter with auto-fix
- id: ruff
args: [--fix]
files: ^(dataframe_expectations|tests)/.*\.py$
stages: [pre-commit, manual]
# Ruff formatter (replaces black)
- id: ruff-format
files: ^(dataframe_expectations|tests)/.*\.py$
stages: [pre-commit, manual]
# ============================================================================
# Type checking - mypy
# ============================================================================
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
files: ^(dataframe_expectations|tests)/.*\.py$
args: [--config-file, ./pyproject.toml]
additional_dependencies: [
types-tabulate,
pandas-stubs,
pyspark-stubs,
types-PyYAML,
pytest,
pytest-cov,
]
stages: [pre-commit, manual]
# ============================================================================
# Stub methods check - custom local hook
# ============================================================================
- repo: local
hooks:
- id: check-stub-methods
name: Check expectation stubs are up-to-date
entry: python scripts/generate_suite_stubs.py --check
language: system
pass_filenames: false
# ============================================================================
# Commit message validation - Conventional Commits
# ============================================================================
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.6.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []