-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
70 lines (63 loc) · 2.65 KB
/
.pre-commit-config.yaml
File metadata and controls
70 lines (63 loc) · 2.65 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
exclude: "^dbt_packages$"
repos:
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0"
hooks:
- id: prettier
- repo: https://github.com/crate-ci/typos
rev: v1.16.6
hooks:
- id: typos
- repo: https://github.com/tconbeer/sqlfmt
rev: v0.29.0
hooks:
- id: sqlfmt
additional_dependencies: ["shandy-sqlfmt[jinjafmt]"]
# Excluded files — sqlfmt damages these in ways that break runtime behavior:
# - ClickHouse/BigQuery files: sqlfmt lowercases case-sensitive identifiers
# (e.g. Nullable, stddevPop, lagInFrame, splitByChar, dateDiff, OFFSET).
# "-- fmt: off" inline comments can't be used here because these macros are
# inlined into compiled SQL, and the comments break ClickHouse's parser.
# - Non-SQL content: files containing embedded Python or YAML that sqlfmt
# destroys (broken indentation, collapsed structure)
# - Unparsable Jinja: complex Jinja patterns sqlfmt cannot parse correctly
# - dbt_packages: symlink to repo root causes infinite recursion
exclude: |
(?x)^(
macros/commands/generate_elementary_cli_profile\.sql|
macros/commands/generate_json_schema_test\.sql|
macros/commands/generate_schema_baseline_test\.sql|
macros/edr/data_monitoring/monitors/column_numeric_monitors\.sql|
macros/edr/data_monitoring/monitors_query/table_monitoring_query\.sql|
macros/edr/system/system_utils/buckets_cte\.sql|
macros/edr/system/system_utils/empty_table\.sql|
macros/edr/system/system_utils/full_names\.sql|
macros/edr/tests/test_json_schema\.sql|
macros/edr/tests/test_utils/compile_py_code\.sql|
macros/utils/cross_db_utils/datediff\.sql|
macros/utils/cross_db_utils/get_user_creation_query\.sql|
macros/utils/cross_db_utils/lag\.sql|
macros/utils/data_types/null_as\.sql|
macros/utils/table_operations/get_row_count\.sql|
integration_tests/dbt_project/macros/python\.sql|
integration_tests/dbt_project/dbt_packages/.*
)$
- repo: local
hooks:
- id: no_commit
name: Check for NO_COMMIT marker
entry: bash -c "git diff --cached -U0 | (! grep NO_COMMIT)"
language: system