1 # Python settings for QMK
4 # Align closing bracket with visual indentation.
5 align_closing_bracket_with_visual_indent=True
7 # Allow dictionary keys to exist on multiple lines. For example:
10 # ('this is the first element of a tuple',
11 # 'this is the second element of a tuple'):
14 allow_multiline_dictionary_keys=False
16 # Allow lambdas to be formatted on more than one line.
17 allow_multiline_lambdas=False
19 # Allow splitting before a default / named assignment in an argument list.
20 allow_split_before_default_or_named_assigns=True
22 # Allow splits before the dictionary value.
23 allow_split_before_dict_value=True
25 # Let spacing indicate operator precedence. For example:
29 # c = (1 + 2) * (3 - 4)
30 # d = (1 - 2) / (3 + 4)
34 # will be formatted as follows to indicate precedence:
43 arithmetic_precedence_indication=True
45 # Number of blank lines surrounding top-level function and class
47 blank_lines_around_top_level_definition=2
49 # Insert a blank line before a class-level docstring.
50 blank_line_before_class_docstring=False
52 # Insert a blank line before a module docstring.
53 blank_line_before_module_docstring=False
55 # Insert a blank line before a 'def' or 'class' immediately nested
56 # within another 'def' or 'class'. For example:
59 # # <------ this blank line
62 blank_line_before_nested_class_or_def=False
64 # Do not split consecutive brackets. Only relevant when
65 # dedent_closing_brackets is set. For example:
67 # call_func_that_takes_a_dict(
76 # call_func_that_takes_a_dict({
80 coalesce_brackets=True
85 # The style for continuation alignment. Possible values are:
87 # - SPACE: Use spaces for continuation alignment. This is default behavior.
88 # - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns
89 # (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs) for continuation
91 # - VALIGN-RIGHT: Vertically align continuation lines with indent
92 # characters. Slightly right (one more indent character) if cannot
93 # vertically align continuation lines with indent characters.
95 # For options FIXED, and VALIGN-RIGHT are only available when USE_TABS is
97 continuation_align_style=SPACE
99 # Indent width used for line continuations.
100 continuation_indent_width=4
102 # Put closing brackets on a separate line, dedented, if the bracketed
103 # expression can't fit in a single line. Applies to all kinds of brackets,
104 # including function definitions and calls. For example:
109 # } # <--- this bracket is dedented and on a separate line
111 # time_series = self.remote_client.query_entity_counters(
112 # entity='dev3246.region1',
113 # key='dns.query_latency_tcp',
114 # transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
115 # start_ts=now()-timedelta(days=3),
117 # ) # <--- this bracket is dedented and on a separate line
118 dedent_closing_brackets=True
120 # Disable the heuristic which places each list element on a separate line
121 # if the list is comma-terminated.
122 disable_ending_comma_heuristic=False
124 # Place each dictionary entry onto its own line.
125 each_dict_entry_on_separate_line=True
127 # The regex for an i18n comment. The presence of this comment stops
128 # reformatting of that line, because the comments are required to be
129 # next to the string they translate.
132 # The i18n function call names. The presence of this function stops
133 # reformattting on that line, because the string it has cannot be moved
134 # away from the i18n comment.
137 # Indent blank lines.
138 indent_blank_lines=False
140 # Indent the dictionary value if it cannot fit on the same line as the
141 # dictionary key. For example:
149 indent_dictionary_value=True
151 # The number of columns to use for indentation.
154 # Join short lines into one line. E.g., single line 'if' statements.
155 join_multiple_lines=False
157 # Do not include spaces around selected binary operators. For example:
161 # will be formatted as follows when configured with "*,/":
164 no_spaces_around_selected_binary_operators=
166 # Use spaces around default or named assigns.
167 spaces_around_default_or_named_assign=False
169 # Use spaces around the power operator.
170 spaces_around_power_operator=False
172 # The number of spaces required before a trailing comment.
173 # This can be a single value (representing the number of spaces
174 # before each trailing comment) or list of values (representing
175 # alignment column values; trailing comments within a block will
176 # be aligned to the first column value that is greater than the maximum
177 # line length within the block). For example:
179 # With spaces_before_comment=5:
181 # 1 + 1 # Adding values
183 # will be formatted as:
185 # 1 + 1 # Adding values <-- 5 spaces between the end of the statement and comment
187 # With spaces_before_comment=15, 20:
189 # 1 + 1 # Adding values
190 # two + two # More adding
192 # longer_statement # This is a longer statement
193 # short # This is a shorter statement
195 # a_very_long_statement_that_extends_beyond_the_final_column # Comment
196 # short # This is a shorter statement
198 # will be formatted as:
200 # 1 + 1 # Adding values <-- end of line comments in block aligned to col 15
201 # two + two # More adding
203 # longer_statement # This is a longer statement <-- end of line comments in block aligned to col 20
204 # short # This is a shorter statement
206 # a_very_long_statement_that_extends_beyond_the_final_column # Comment <-- the end of line comments are aligned based on the line length
207 # short # This is a shorter statement
209 spaces_before_comment=2
211 # Insert a space between the ending comma and closing bracket of a list,
213 space_between_ending_comma_and_closing_bracket=False
215 # Split before arguments
216 split_all_comma_separated_values=False
218 # Split before arguments if the argument list is terminated by a
220 split_arguments_when_comma_terminated=True
222 # Set to True to prefer splitting before '+', '-', '*', '/', '//', or '@'
224 split_before_arithmetic_operator=False
226 # Set to True to prefer splitting before '&', '|' or '^' rather than
228 split_before_bitwise_operator=True
230 # Split before the closing bracket if a list or dict literal doesn't fit on
232 split_before_closing_bracket=True
234 # Split before a dictionary or set generator (comp_for). For example, note
235 # the split before the 'for':
238 # variable: 'Hello world, have a nice day!'
239 # for variable in bar if variable != 42
241 split_before_dict_set_generator=True
243 # Split before the '.' if we need to split a longer expression:
245 # foo = ('This is a really long string: {}, {}, {}, {}'.format(a, b, c, d))
247 # would reformat to something like:
249 # foo = ('This is a really long string: {}, {}, {}, {}'
250 # .format(a, b, c, d))
251 split_before_dot=False
253 # Split after the opening paren which surrounds an expression if it doesn't
254 # fit on a single line.
255 split_before_expression_after_opening_paren=False
257 # If an argument / parameter list is going to be split, then split before
258 # the first argument.
259 split_before_first_argument=False
261 # Set to True to prefer splitting before 'and' or 'or' rather than
263 split_before_logical_operator=False
265 # Split named assignments onto individual lines.
266 split_before_named_assigns=True
268 # Set to True to split list comprehensions and generators that have
269 # non-trivial expressions and multiple clauses before each of these
270 # clauses. For example:
273 # a_long_var + 100 for a_long_var in xrange(1000)
274 # if a_long_var % 10]
276 # would reformat to something like:
280 # for a_long_var in xrange(1000)
281 # if a_long_var % 10]
282 split_complex_comprehension=True
284 # The penalty for splitting right after the opening bracket.
285 split_penalty_after_opening_bracket=300
287 # The penalty for splitting the line after a unary operator.
288 split_penalty_after_unary_operator=10000
290 # The penalty of splitting the line around the '+', '-', '*', '/', '//',
291 # ``%``, and '@' operators.
292 split_penalty_arithmetic_operator=300
294 # The penalty for splitting right before an if expression.
295 split_penalty_before_if_expr=0
297 # The penalty of splitting the line around the '&', '|', and '^'
299 split_penalty_bitwise_operator=300
301 # The penalty for splitting a list comprehension or generator
303 split_penalty_comprehension=80
305 # The penalty for characters over the column limit.
306 split_penalty_excess_character=7000
308 # The penalty incurred by adding a line split to the unwrapped line. The
309 # more line splits added the higher the penalty.
310 split_penalty_for_added_line_split=30
312 # The penalty of splitting a list of "import as" names. For example:
314 # from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
318 # would reformat to something like:
320 # from a_very_long_or_indented_module_name_yada_yad import (
321 # long_argument_1, long_argument_2, long_argument_3)
322 split_penalty_import_names=0
324 # The penalty of splitting the line around the 'and' and 'or'
326 split_penalty_logical_operator=300
328 # Use the Tab character for indentation.