forked from get-select/dbt-snowflake-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
120 lines (102 loc) · 6.96 KB
/
tox.ini
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
[tox]
skipsdist = True
envlist = integration_snowflake
[sqlfluff]
dialect = snowflake
templater = dbt
rules = L001,L003,L004,L005,L006,L007,L008,L010,L011,L012,L014,L015,L017,L018,L021,L022,L023,L025,L027,L028,L030,L035,L036,L037,L039,L040,L041,L045,L046,L048,L051,L055
# L001 Unnecessary trailing whitespace, sqlfluff fix compatible. # https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L001
# L003 Indentation not consistent with previous lines, sqlfluff fix compatible. # https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L003
# L004 Indentation should be with spaces, not tabs, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L004
# L005 Commas should not have whitespace directly before them, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L005
# L006 Operators should be surrounded by a single whitespace, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L006
# L007 Operators should be after newlines. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L007
# L008 Commas should be followed by a single whitespace unless followed by a comment, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L008
# L010 Inconsistent capitalisation of keywords, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L010
# L011 Implicit/explicit aliasing of table, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L011
# L012 Implicit/explicit aliasing of columns. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L012
# L014 Inconsistent capitalisation of unquoted identifiers, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L014
# L015 DISTINCT used with parentheses, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L015
# L017 Function name not immediately followed by bracket, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L017
# L018 WITH clause closing bracket should be aligned with WITH keyword, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L018
# L021 Ambiguous use of DISTINCT in select statement with GROUP BY. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L021
# L022 Blank line expected but not found after CTE closing bracket, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L022
# L023 Single whitespace expected after AS in WITH clause, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L023
# L025 Tables should not be aliased if that alias is not used, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L025
# L027 References should be qualified if select has more than one referenced table/view. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L027
# L028 References should be consistent in statements with a single table. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L028
# L030 Inconsistent capitalisation of function names, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L030
# L035 Do not specify "else null" in a case when statement (redundant), sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L035
# L036 Select targets should be on a new line unless there is only one select target, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L036
# L037 Ambiguous ordering directions for columns in order by clause, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L037
# L039 Unnecessary whitespace found, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L039
# L040 Inconsistent capitalisation of boolean/null literal. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L040
# L041 SELECT clause modifiers such as DISTINCT must be on the same line as SELECT, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L041
# L045 Query defines a CTE (common-table expression) but does not use it, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L045
# L046 Jinja tags should have a single whitespace on either side. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L046
# L048 Quoted literals should be surrounded by a single whitespace, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L048
# L051 INNER JOIN must be fully qualified, sqlfluff fix compatible. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L051
# L055 Use LEFT JOIN instead of RIGHT JOIN. https://docs.sqlfluff.com/en/stable/rules.html#sqlfluff.core.rules.Rule_L055
deps =
sqlfluff-templater-dbt
dbt-snowflake~=1.3.0
[sqlfluff:rules:L004]
indent_unit = space
tab_space_size = 4
[sqlfluff:rules:L010]
capitalisation_policy = lower
[sqlfluff:rules:L014]
capitalisation_policy = lower
[sqlfluff:rules:L028]
single_table_references = unqualified
[sqlfluff:rules:L030]
capitalisation_policy = lower
[sqlfluff:rules:L040]
capitalisation_policy = lower
[sqlfluff:rules:L042]
forbid_subquery_in = both
[testenv]
passenv =
DBT_PROFILES_DIR
GITHUB_SHA
GITHUB_SHA_OVERRIDE
DBT_ENV_SECRET_SNOWFLAKE_TEST_ACCOUNT
DBT_ENV_SECRET_SNOWFLAKE_TEST_USER
DBT_ENV_SECRET_SNOWFLAKE_TEST_PASSWORD
DBT_ENV_SECRET_SNOWFLAKE_TEST_ROLE
DBT_ENV_SECRET_SNOWFLAKE_TEST_DATABASE
DBT_ENV_SECRET_SNOWFLAKE_TEST_WAREHOUSE
[testenv:lint]
deps = {[sqlfluff]deps}
commands = sqlfluff lint {posargs} --ignore parsing
[testenv:lint_all]
deps = {[sqlfluff]deps}
commands =
dbt deps
sqlfluff lint models --ignore parsing
[testenv:fix]
deps = {[sqlfluff]deps}
commands = sqlfluff fix {posargs} --ignore parsing -f
[testenv:fix_all]
deps = {[sqlfluff]deps}
commands = sqlfluff fix models --ignore parsing -f
[testenv:generate_docs]
deps = dbt-snowflake~=1.3.0
commands = dbt docs generate
[testenv:integration_snowflake]
changedir = integration_test_project
deps = dbt-snowflake~=1.3.0
commands =
dbt deps
dbt build -s +daily_spend --full-refresh
dbt build --exclude dbt_snowflake_monitoring --full-refresh
dbt build -s +daily_spend
dbt build --exclude dbt_snowflake_monitoring
[testenv:snowflake]
deps = dbt-snowflake~=1.3.0
commands =
dbt deps
dbt build -s dbt_snowflake_monitoring --full-refresh
dbt build --exclude dbt_snowflake_monitoring --full-refresh
dbt build -s dbt_snowflake_monitoring
dbt build --exclude dbt_snowflake_monitoring