-
Notifications
You must be signed in to change notification settings - Fork 5
/
.pre-commit-config.yaml
104 lines (104 loc) · 3.07 KB
/
.pre-commit-config.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-json
- id: check-ast
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
exclude: .+\.csv$
# Useful if you want to enforce feature branches beginning with a Jira ticket ID
# - id: no-commit-to-branch
# name: JIRA ticket ID in branch
# args: ['--pattern', '^((?![A-Z]+[-][0-9]+[-][\S]+).)*$']
- repo: local
hooks:
- id: isort
entry: python -m isort --profile black --filter-files
language: system
name: isort
pass_filenames: true
- repo: local
hooks:
- id: black
entry: python -m black
language: system
name: Run black formatter
pass_filenames: true
types_or: [python, pyi]
- repo: local
hooks:
- id: autoflake
entry: python -m autoflake --in-place --remove-all-unused-imports
language: system
name: Run autoflake
pass_filenames: true
types_or: [python, pyi]
- repo: local
hooks:
- id: pyupgrade
entry: python -m pyupgrade
language: system
name: Check for code that can use new Python features
pass_filenames: true
types_or: [python, pyi]
- repo: local
hooks:
- id: pytest-no-deps
name: pytest-no-deps
entry: pytest ./tests/pytest -m no_deps -n 5
language: system
pass_filenames: false
always_run: true
- repo: local
hooks:
- id: sqlfmt
entry: python -m sqlfmt
language: system
name: Run sqlfmt
pass_filenames: true
types_or: [jinja, sql]
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v2.0.6
hooks:
- id: dbt-parse
- id: dbt-docs-generate
args: ["--cmd-flags", "++threads", "64"]
- id: check-model-has-properties-file
name: Check that all models are listed in a YAML file
files: ^models/intermediate/|^models/marts/|^models/staging/
- id: check-model-name-contract
args: [--pattern, "(int_).*"]
files: models/intermediate/
- id: check-model-name-contract
args: [--pattern, "(dim_|fct_|rpt_).*"]
files: models/marts/
- id: check-model-name-contract
args: [--pattern, "(base_|stg_).*"]
files: models/staging/
- id: check-model-name-contract
args: [--pattern, "^seed_.*csv$"]
files: models/seeds/
- repo: local
hooks:
- id: pytest-catalog-json
name: pytest-catalog-json
entry: pytest ./tests/pytest -m catalog_json -n 5
language: system
pass_filenames: false
always_run: true
- repo: local
hooks:
- id: pytest-manifest-json
name: pytest-manifest-json
entry: pytest ./tests/pytest -m manifest_json -n 5
language: system
pass_filenames: false
always_run: true