forked from webermatias/course_advanced_dbt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
37 lines (35 loc) · 1.51 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
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/sqlfluff/sqlfluff
rev: 2.1.2
hooks:
- id: sqlfluff-lint
additional_dependencies: [
'dbt-snowflake==1.5.2',
'sqlfluff-templater-dbt==2.1.2']
- id: sqlfluff-fix
stages: [manual] # this command is available only to run manually
additional_dependencies: [
'dbt-snowflake==1.5.2',
'sqlfluff-templater-dbt==2.1.2']
- repo: https://github.com/dbt-checkpoint/dbt-checkpoint
rev: v1.1.1
hooks:
- id: dbt-compile # Compiles dbt (necessary for future hooks)
- id: dbt-docs-generate # Generates the dbt docs (necessary for some future hooks)
- id: check-source-table-has-description # Ensures all source tables have descriptions
- id: check-model-has-tests # Ensures all models have at least 2 tests
args: ["--test-cnt", "1", "--"]
files: ^models/
- id: check-script-semicolon # Ensure that the model does not have a semicolon at the end of the file.
- id: check-script-has-no-table-name # Ensures models only use source or ref macro to specify the table name.
- id: check-model-has-all-columns # Ensures that mart models have all columns in the database also specified in the .yml
files: ^models/marts
- id: check-model-tags
args: ["--tags", "hourly", "monthly", "daily", "weekly", "--"]
files: ^models/marts/core/