@@ -73,6 +73,57 @@ indented_using_on = False
7373indented_on_contents = True
7474template_blocks_indent = True
7575
76+ # Layout configuration
77+ # See https://docs.sqlfluff.com/en/stable/layout.html#configuring-layout-and-spacing
78+ [sqlfluff:layout:type:comma]
79+ spacing_before = touch
80+ line_position = trailing
81+
82+ [sqlfluff:layout:type:binary_operator]
83+ line_position = trailing
84+
85+ [sqlfluff:layout:type:statement_terminator]
86+ spacing_before = touch
87+ line_position = trailing
88+
89+ [sqlfluff:layout:type:end_of_file]
90+ spacing_before = touch
91+
92+ [sqlfluff:layout:type:set_operator]
93+ line_position = alone:strict
94+
95+ [sqlfluff:layout:type:start_bracket]
96+ spacing_after = touch
97+
98+ [sqlfluff:layout:type:end_bracket]
99+ spacing_before = touch
100+
101+ [sqlfluff:layout:type:start_square_bracket]
102+ spacing_after = touch
103+
104+ [sqlfluff:layout:type:end_square_bracket]
105+ spacing_before = touch
106+
107+ [sqlfluff:layout:type:casting_operator]
108+ spacing_before = touch
109+ spacing_after = touch
110+
111+ [sqlfluff:layout:type:comparison_operator]
112+ spacing_within = touch
113+ line_position = leading
114+
115+ [sqlfluff:layout:type:object_reference]
116+ spacing_within = inline
117+
118+ [sqlfluff:layout:type:comment]
119+ spacing_before = any
120+ spacing_after = any
121+
122+ # Template loop tokens shouldn't dictate spacing around them.
123+ [sqlfluff:layout:type:template_loop]
124+ spacing_before = any
125+ spacing_after = any
126+
76127[sqlfluff:templater]
77128unwrap_wrapped_queries = True
78129
@@ -84,7 +135,6 @@ apply_dbt_builtins = True
84135tab_space_size = 2
85136max_line_length = 80
86137indent_unit = space
87- comma_style = trailing
88138allow_scalar = True
89139single_table_references = consistent
90140unquoted_identifiers_policy = all
@@ -93,6 +143,9 @@ unquoted_identifiers_policy = all
93143[sqlfluff:rules:L003]
94144hanging_indents = True
95145
146+ # TODO - remove once 1.4.1 fully rolled out as this has been replaced by
147+ # [sqlfluff:layout:type:binary_operator]
148+ # line_position = trailing
96149[sqlfluff:rules:L007]
97150operator_new_lines = before
98151
0 commit comments