11[sqlfluff]
2- ## verbose is an integer (0-2) indicating the level of log output
2+ # verbose is an integer (0-2) indicating the level of log output
33verbose = 0
4- ## Turn off color formatting of output
4+ # Turn off color formatting of output
55nocolor = False
6- ## Supported dialects https://docs.sqlfluff.com/en/stable/dialects.html
7- ## Or run 'sqlfluff dialects'
6+ # Supported dialects https://docs.sqlfluff.com/en/stable/dialects.html
7+ # Or run 'sqlfluff dialects'
88dialect = bigquery
9- ## One of [raw|jinja|python|placeholder]
9+ # One of [raw|jinja|python|placeholder]
1010templater = jinja
11- ## Comma separated list of rules to check, or None for all
12- rules = None
13- ## Comma separated list of rules to exclude, or None
11+ # Comma separated list of rules to check, default to all
12+ rules = all
13+ # Comma separated list of rules to exclude, or None
1414exclude_rules = L011,L014,L016,L020,L022,L026,L027,L028,L029,L030,L031,L032,L034,L035,L036,L037,L042,L043,L051,L060
1515# L011 - We don't always alias tables with AS ("FROM table1 AS tb1" instead of "FROM table1 tb1"). Do for columns but not for tables.
1616# L014 - Unquoted identifiers (e.g. column names) will be mixed case so don't enforce case
@@ -38,7 +38,11 @@ recurse = 0
3838output_line_length = 80
3939# Number of passes to run before admitting defeat
4040runaway_limit = 10
41- # Ignore linting errors in templated sections
41+ # Ignore errors by category (one or more of the following, separated by commas: lexing,linting,parsing,templating)
42+ ignore = None
43+ # Ignore linting errors found within sections of code coming directly from
44+ # templated code (e.g. from within Jinja curly braces. Note that it does not
45+ # ignore errors from literal code found within template loops.
4246ignore_templated_areas = True
4347# can either be autodetect or a valid encoding e.g. utf-8, utf-8-sig
4448encoding = autodetect
@@ -47,12 +51,26 @@ disable_noqa = False
4751# Comma separated list of file extensions to lint
4852# NB: This config will only apply in the root folder
4953sql_file_exts = .sql,.sql.j2,.dml,.ddl
50-
54+ # Allow fix to run on files, even if they contain parsing errors
55+ # Note altering this is NOT RECOMMENDED as can corrupt SQL
56+ fix_even_unparsable = False
57+ # Very large files can make the parser effectively hang.
58+ # This limit skips files over a certain character length
59+ # and warns the user what has happened.
60+ # Set this to 0 to disable.
61+ large_file_skip_char_limit = 40000
62+ # CPU processes to use while linting.
63+ # If positive, just implies number of processes.
64+ # If negative or zero, implies number_of_cpus - specifed_number.
65+ # e.g. -1 means use all processors but one. 0 means all cpus.
66+ processes = -1
5167
5268[sqlfluff:indentation]
53- ## See https://docs.sqlfluff.com/en/stable/indentation.html
69+ # See https://docs.sqlfluff.com/en/stable/indentation.html
5470indented_joins = False
71+ indented_ctes = False
5572indented_using_on = False
73+ indented_on_contents = True
5674template_blocks_indent = True
5775
5876[sqlfluff:templater]
@@ -61,15 +79,7 @@ unwrap_wrapped_queries = True
6179[sqlfluff:templater:jinja]
6280apply_dbt_builtins = True
6381
64- [sqlfluff:templater:jinja:macros]
65- # Macros provided as builtins for dbt projects
66- dbt_ref = {% macro ref(model_ref) %}{{model_ref}}{% endmacro %}
67- dbt_source = {% macro source(source_name, table) %}{{source_name}}_{{table}}{% endmacro %}
68- dbt_config = {% macro config() %}{% for k in kwargs %}{% endfor %}{% endmacro %}
69- dbt_var = {% macro var(variable) %}item{% endmacro %}
70- dbt_is_incremental = {% macro is_incremental() %}True{% endmacro %}
71-
72- # Some rules can be configured directly from the config common to other rules.
82+ # Some rules can be configured directly from the config common to other rules
7383[sqlfluff:rules]
7484tab_space_size = 2
7585max_line_length = 80
@@ -81,31 +91,100 @@ unquoted_identifiers_policy = all
8191
8292# Some rules have their own specific config.
8393[sqlfluff:rules:L003]
84- lint_templated_tokens = True
94+ hanging_indents = True
8595
8696[sqlfluff:rules:L007]
8797operator_new_lines = before
8898
8999[sqlfluff:rules:L010]
90100# Keywords
91101capitalisation_policy = upper
102+ # Comma separated list of words to ignore for this rule
103+ ignore_words = None
104+ ignore_words_regex = None
105+
106+ [sqlfluff:rules:L011]
107+ # Aliasing preference for tables
108+ aliasing = explicit
92109
93110[sqlfluff:rules:L012]
94111# Aliasing preference for columns
95112aliasing = explicit
96113
114+ [sqlfluff:rules:L014]
115+ # Unquoted identifiers
116+ extended_capitalisation_policy = consistent
117+ # Comma separated list of words to ignore for this rule
118+ ignore_words = None
119+ ignore_words_regex = None
120+
121+ [sqlfluff:rules:L016]
122+ # Line length
123+ ignore_comment_lines = False
124+ ignore_comment_clauses = False
125+
126+ [sqlfluff:rules:L027]
127+ # Comma separated list of words to ignore for this rule
128+ ignore_words = None
129+ ignore_words_regex = None
130+
131+ [sqlfluff:rules:L026]
132+ # References must be in FROM clause
133+ # Disabled for some dialects (e.g. bigquery)
134+ force_enable = False
135+
136+ [sqlfluff:rules:L028]
137+ # References must be consistently used
138+ # Disabled for some dialects (e.g. bigquery)
139+ force_enable = False
140+
141+ [sqlfluff:rules:L029]
142+ # Keywords should not be used as identifiers.
143+ unquoted_identifiers_policy = aliases
144+ quoted_identifiers_policy = none
145+ # Comma separated list of words to ignore for this rule
146+ ignore_words = None
147+ ignore_words_regex = None
148+
149+ [sqlfluff:rules:L030]
150+ # Function names
151+ extended_capitalisation_policy = consistent
152+ # Comma separated list of words to ignore for this rule
153+ ignore_words = None
154+ ignore_words_regex = None
155+
156+ [sqlfluff:rules:L031]
157+ # Avoid table aliases in from clauses and join conditions.
158+ # Disabled for some dialects (e.g. bigquery)
159+ force_enable = False
160+
161+ [sqlfluff:rules:L036]
162+ wildcard_policy = single
163+
97164[sqlfluff:rules:L038]
165+ # Trailing commas
98166select_clause_trailing_comma = forbid
99167
100168[sqlfluff:rules:L040]
101169# Null & Boolean Literals
102170capitalisation_policy = consistent
171+ # Comma separated list of words to ignore for this rule
172+ ignore_words = None
173+ ignore_words_regex = None
174+
175+ [sqlfluff:rules:L042]
176+ # By default, allow subqueries in from clauses, but not join clauses
177+ forbid_subquery_in = join
103178
104179[sqlfluff:rules:L047]
105180# Consistent syntax to count all rows
106181prefer_count_1 = False
107182prefer_count_0 = True
108183
184+ [sqlfluff:rules:L051]
185+ # Fully qualify JOIN clause
186+ fully_qualify_join_types = inner
187+
109188[sqlfluff:rules:L052]
110189# Semi-colon formatting approach
111190multiline_newline = False
@@ -121,6 +200,15 @@ unquoted_identifiers_policy = all
121200quoted_identifiers_policy = all
122201allow_space_in_identifier = False
123202additional_allowed_characters = "-."
203+ ignore_words = None
204+ ignore_words_regex = None
205+
206+ [sqlfluff:rules:L059]
207+ # Policy on quoted and unquoted identifiers
208+ prefer_quoted_identifiers = False
209+ ignore_words = None
210+ ignore_words_regex = None
211+ force_enable = False
124212
125213[sqlfluff:rules:L062]
126214# Comma separated list of blocked words that should not be used
@@ -138,9 +226,14 @@ blocked_regex = (2022_?05_?12|2022_?06_?09|2022_?07_?01|2021_?06_?01)
138226extended_capitalisation_policy = upper
139227# Comma separated list of words to ignore for this rule
140228ignore_words = None
229+ ignore_words_regex = None
141230
142231[sqlfluff:rules:L064]
143232# Consistent usage of preferred quotes for quoted literals
144233preferred_quoted_literal_style = single_quotes
145234# Disabled for dialects that do not support single and double quotes for quoted literals (e.g. Postgres)
146235force_enable = False
236+
237+ [sqlfluff:rules:L066]
238+ min_alias_length = None
239+ max_alias_length = None
0 commit comments