-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path{% if z_pre_commit %}.pre-commit-config.yaml{% endif %}.jinja
More file actions
43 lines (40 loc) · 1.77 KB
/
{% if z_pre_commit %}.pre-commit-config.yaml{% endif %}.jinja
File metadata and controls
43 lines (40 loc) · 1.77 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
files: ^{{ dbt_project_dir }}/models/
repos:
{% if use_dbt_checkpoint %}
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: {{dbt_checkpoint_version}}
hooks:
- id: check-source-table-has-description
- id: check-script-semicolon
- id: check-script-has-no-table-name
- id: check-script-ref-and-source
- id: check-model-has-description
- id: check-model-has-properties-file
- id: check-model-has-all-columns
{% endif %}
{% if use_sqlfluff %}
- repo: https://github.com/sqlfluff/sqlfluff
# this is the version of sqlfluff, needs to be updated when using a new sqlfluff version (pip show sqlfluff)
rev: {{sqlfluff_version}}
hooks:
- id: sqlfluff-lint
language: python
# Need these two dependencies.
# sqlfluff-templater-dbt should match the version of sqlfluff above in rev (pip show sqlfluff-templater-dbt)
# dbt-snowflake needs to match the version in transform tab of Datacoves (pip show dbt-snowflake)
additional_dependencies:
[
sqlfluff-templater-dbt=={{sqlfluff_version}},
{% if 'snowflake' in dbt_adapter %}dbt-snowflake=={{dbt_adapter_version}},{% elif 'redshift' in dbt_adapter %}dbt-redshift=={{dbt_adapter_version}},{% elif 'databricks' in dbt_adapter %}dbt-databricks=={{dbt_adapter_version}},{% elif 'bigquery' in dbt_adapter %}dbt-bigquery=={{dbt_adapter_version}},{% endif %}
dbt-core=={{dbt_core_version}},
]
args: [--config, "{{ dbt_project_dir }}/.sqlfluff"]
{% endif %}
{% if use_yamllint %}
- repo: https://github.com/adrienverge/yamllint.git
rev: {{yamllint_version}}
hooks:
- id: yamllint
args: [-c=.yamllint]
exclude: ^{{ dbt_project_dir }}/.dbt_coves/templates
{% endif %}