-
Notifications
You must be signed in to change notification settings - Fork 0
/
.sqlfluff
70 lines (62 loc) · 3.04 KB
/
.sqlfluff
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
# For a full reference of the SQLFluff rules, see https://docs.sqlfluff.com/en/stable/rules.html
[sqlfluff]
dialect = snowflake
# templater = dbt
# The dbt templater is slower than the jinja templater, as it first compiles the dbt code into data warehouse code. If you don't need to use the dbt templater, uncomment the line below
templater = jinja
runaway_limit = 10 # Number of passes to run before admitting defeat
max_line_length = 120
sql_file_exts = .sql,.sql.j2,.dml,.ddl
large_file_skip_byte_limit = 30000 # Very large files can make the parser effectively hang
#-----------------------------------------------------------------------------------
# General Formatting Rules
#-----------------------------------------------------------------------------------
[sqlfluff:indentation]
indent_unit = space
tab_space_size = 4
indented_joins = true
indented_using_on = true
template_blocks_indent = true
#-----------------------------------------------------------------------------------
# Comma rules
#-----------------------------------------------------------------------------------
[sqlfluff:layout:type:comma]
line_position = leading
[sqlfluff:rules:convention.select_trailing_comma] # trailing commas within select clauses
select_clause_trailing_comma = forbid
#-----------------------------------------------------------------------------------
# Capitalisation rules
#-----------------------------------------------------------------------------------
[sqlfluff:rules:capitalisation.keywords] # Inconsistent capitalisation of keywords.
capitalisation_policy = upper
[sqlfluff:rules:capitalisation.identifiers] # Inconsistent column, table, CTE & other names
extended_capitalisation_policy = consistent
ignore_words = None
[sqlfluff:rules:capitalisation.functions] # Inconsistent capitalisation of function names.
extended_capitalisation_policy = upper
[sqlfluff:rules:capitalisation.literals] # Inconsistent capitalisation of null & boolean literals.
capitalisation_policy = upper
[sqlfluff:rules:capitalisation.types] # Inconsistent capitalisation of data types.
extended_capitalisation_policy = upper
# Other
[sqlfluff:rules:ambiguous.column_references] # Use column names in group by statements.
group_by_and_order_by_style = explicit
[sqlfluff:rules:aliasing.length] # The minimum length of an alias to allow without raising a violation.
min_alias_length = 3
# Some rules can be configured from the config common to other rules
[sqlfluff:rules]
allow_scalar = true
single_table_references = unqualified # table references aren't necessary in statements with a single table.
unquoted_identifiers_policy = all
#-----------------------------------------------------------------------------------
# Templater rules
#-----------------------------------------------------------------------------------
[sqlfluff:templater]
unwrap_wrapped_queries = true
[sqlfluff:templater:dbt] # pass in our dbt project/cred details
project_dir =
profiles_dir =
profile =
[sqlfluff:templater:dbt:context] # Default values for custom DBT macro context
[sqlfluff:templater:jinja]
apply_dbt_builtins = true