diff options
author | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2022-04-10 12:13:40 +0100 |
commit | dc90387ce7d8ba7b607d9c48540bf6d8b560f14d (patch) | |
tree | 4ccb8fa5886b66fa9d480edef74236c27f035e16 /setup.cfg |
Diffstat (limited to 'setup.cfg')
-rw-r--r-- | setup.cfg | 340 |
1 files changed, 340 insertions, 0 deletions
diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..baa6a0396 --- /dev/null +++ b/setup.cfg | |||
@@ -0,0 +1,340 @@ | |||
1 | # Python settings for QMK | ||
2 | [flake8] | ||
3 | ignore = | ||
4 | # QMK is ok with long lines. | ||
5 | E501 | ||
6 | # Conflicts with our yapf config | ||
7 | E231 | ||
8 | per_file_ignores = | ||
9 | **/__init__.py:F401 | ||
10 | |||
11 | # Let's slowly crank this down | ||
12 | max_complexity=16 | ||
13 | |||
14 | [yapf] | ||
15 | # Align closing bracket with visual indentation. | ||
16 | align_closing_bracket_with_visual_indent=True | ||
17 | |||
18 | # Allow dictionary keys to exist on multiple lines. For example: | ||
19 | # | ||
20 | # x = { | ||
21 | # ('this is the first element of a tuple', | ||
22 | # 'this is the second element of a tuple'): | ||
23 | # value, | ||
24 | # } | ||
25 | allow_multiline_dictionary_keys=False | ||
26 | |||
27 | # Allow lambdas to be formatted on more than one line. | ||
28 | allow_multiline_lambdas=False | ||
29 | |||
30 | # Allow splitting before a default / named assignment in an argument list. | ||
31 | allow_split_before_default_or_named_assigns=True | ||
32 | |||
33 | # Allow splits before the dictionary value. | ||
34 | allow_split_before_dict_value=True | ||
35 | |||
36 | # Let spacing indicate operator precedence. For example: | ||
37 | # | ||
38 | # a = 1 * 2 + 3 / 4 | ||
39 | # b = 1 / 2 - 3 * 4 | ||
40 | # c = (1 + 2) * (3 - 4) | ||
41 | # d = (1 - 2) / (3 + 4) | ||
42 | # e = 1 * 2 - 3 | ||
43 | # f = 1 + 2 + 3 + 4 | ||
44 | # | ||
45 | # will be formatted as follows to indicate precedence: | ||
46 | # | ||
47 | # a = 1*2 + 3/4 | ||
48 | # b = 1/2 - 3*4 | ||
49 | # c = (1+2) * (3-4) | ||
50 | # d = (1-2) / (3+4) | ||
51 | # e = 1*2 - 3 | ||
52 | # f = 1 + 2 + 3 + 4 | ||
53 | # | ||
54 | arithmetic_precedence_indication=True | ||
55 | |||
56 | # Number of blank lines surrounding top-level function and class | ||
57 | # definitions. | ||
58 | blank_lines_around_top_level_definition=2 | ||
59 | |||
60 | # Insert a blank line before a class-level docstring. | ||
61 | blank_line_before_class_docstring=False | ||
62 | |||
63 | # Insert a blank line before a module docstring. | ||
64 | blank_line_before_module_docstring=False | ||
65 | |||
66 | # Insert a blank line before a 'def' or 'class' immediately nested | ||
67 | # within another 'def' or 'class'. For example: | ||
68 | # | ||
69 | # class Foo: | ||
70 | # # <------ this blank line | ||
71 | # def method(): | ||
72 | # ... | ||
73 | blank_line_before_nested_class_or_def=False | ||
74 | |||
75 | # Do not split consecutive brackets. Only relevant when | ||
76 | # dedent_closing_brackets is set. For example: | ||
77 | # | ||
78 | # call_func_that_takes_a_dict( | ||
79 | # { | ||
80 | # 'key1': 'value1', | ||
81 | # 'key2': 'value2', | ||
82 | # } | ||
83 | # ) | ||
84 | # | ||
85 | # would reformat to: | ||
86 | # | ||
87 | # call_func_that_takes_a_dict({ | ||
88 | # 'key1': 'value1', | ||
89 | # 'key2': 'value2', | ||
90 | # }) | ||
91 | coalesce_brackets=True | ||
92 | |||
93 | # The column limit. | ||
94 | column_limit=256 | ||
95 | |||
96 | # The style for continuation alignment. Possible values are: | ||
97 | # | ||
98 | # - SPACE: Use spaces for continuation alignment. This is default behavior. | ||
99 | # - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns | ||
100 | # (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs) for continuation | ||
101 | # alignment. | ||
102 | # - VALIGN-RIGHT: Vertically align continuation lines with indent | ||
103 | # characters. Slightly right (one more indent character) if cannot | ||
104 | # vertically align continuation lines with indent characters. | ||
105 | # | ||
106 | # For options FIXED, and VALIGN-RIGHT are only available when USE_TABS is | ||
107 | # enabled. | ||
108 | continuation_align_style=SPACE | ||
109 | |||
110 | # Indent width used for line continuations. | ||
111 | continuation_indent_width=4 | ||
112 | |||
113 | # Put closing brackets on a separate line, dedented, if the bracketed | ||
114 | # expression can't fit in a single line. Applies to all kinds of brackets, | ||
115 | # including function definitions and calls. For example: | ||
116 | # | ||
117 | # config = { | ||
118 | # 'key1': 'value1', | ||
119 | # 'key2': 'value2', | ||
120 | # } # <--- this bracket is dedented and on a separate line | ||
121 | # | ||
122 | # time_series = self.remote_client.query_entity_counters( | ||
123 | # entity='dev3246.region1', | ||
124 | # key='dns.query_latency_tcp', | ||
125 | # transform=Transformation.AVERAGE(window=timedelta(seconds=60)), | ||
126 | # start_ts=now()-timedelta(days=3), | ||
127 | # end_ts=now(), | ||
128 | # ) # <--- this bracket is dedented and on a separate line | ||
129 | dedent_closing_brackets=True | ||
130 | |||
131 | # Disable the heuristic which places each list element on a separate line | ||
132 | # if the list is comma-terminated. | ||
133 | disable_ending_comma_heuristic=False | ||
134 | |||
135 | # Place each dictionary entry onto its own line. | ||
136 | each_dict_entry_on_separate_line=True | ||
137 | |||
138 | # The regex for an i18n comment. The presence of this comment stops | ||
139 | # reformatting of that line, because the comments are required to be | ||
140 | # next to the string they translate. | ||
141 | i18n_comment= | ||
142 | |||
143 | # The i18n function call names. The presence of this function stops | ||
144 | # reformattting on that line, because the string it has cannot be moved | ||
145 | # away from the i18n comment. | ||
146 | i18n_function_call= | ||
147 | |||
148 | # Indent blank lines. | ||
149 | indent_blank_lines=False | ||
150 | |||
151 | # Indent the dictionary value if it cannot fit on the same line as the | ||
152 | # dictionary key. For example: | ||
153 | # | ||
154 | # config = { | ||
155 | # 'key1': | ||
156 | # 'value1', | ||
157 | # 'key2': value1 + | ||
158 | # value2, | ||
159 | # } | ||
160 | indent_dictionary_value=True | ||
161 | |||
162 | # The number of columns to use for indentation. | ||
163 | indent_width=4 | ||
164 | |||
165 | # Join short lines into one line. E.g., single line 'if' statements. | ||
166 | join_multiple_lines=False | ||
167 | |||
168 | # Do not include spaces around selected binary operators. For example: | ||
169 | # | ||
170 | # 1 + 2 * 3 - 4 / 5 | ||
171 | # | ||
172 | # will be formatted as follows when configured with "*,/": | ||
173 | # | ||
174 | # 1 + 2*3 - 4/5 | ||
175 | no_spaces_around_selected_binary_operators= | ||
176 | |||
177 | # Use spaces around default or named assigns. | ||
178 | spaces_around_default_or_named_assign=False | ||
179 | |||
180 | # Use spaces around the power operator. | ||
181 | spaces_around_power_operator=False | ||
182 | |||
183 | # The number of spaces required before a trailing comment. | ||
184 | # This can be a single value (representing the number of spaces | ||
185 | # before each trailing comment) or list of values (representing | ||
186 | # alignment column values; trailing comments within a block will | ||
187 | # be aligned to the first column value that is greater than the maximum | ||
188 | # line length within the block). For example: | ||
189 | # | ||
190 | # With spaces_before_comment=5: | ||
191 | # | ||
192 | # 1 + 1 # Adding values | ||
193 | # | ||
194 | # will be formatted as: | ||
195 | # | ||
196 | # 1 + 1 # Adding values <-- 5 spaces between the end of the statement and comment | ||
197 | # | ||
198 | # With spaces_before_comment=15, 20: | ||
199 | # | ||
200 | # 1 + 1 # Adding values | ||
201 | # two + two # More adding | ||
202 | # | ||
203 | # longer_statement # This is a longer statement | ||
204 | # short # This is a shorter statement | ||
205 | # | ||
206 | # a_very_long_statement_that_extends_beyond_the_final_column # Comment | ||
207 | # short # This is a shorter statement | ||
208 | # | ||
209 | # will be formatted as: | ||
210 | # | ||
211 | # 1 + 1 # Adding values <-- end of line comments in block aligned to col 15 | ||
212 | # two + two # More adding | ||
213 | # | ||
214 | # longer_statement # This is a longer statement <-- end of line comments in block aligned to col 20 | ||
215 | # short # This is a shorter statement | ||
216 | # | ||
217 | # a_very_long_statement_that_extends_beyond_the_final_column # Comment <-- the end of line comments are aligned based on the line length | ||
218 | # short # This is a shorter statement | ||
219 | # | ||
220 | spaces_before_comment=2 | ||
221 | |||
222 | # Insert a space between the ending comma and closing bracket of a list, | ||
223 | # etc. | ||
224 | space_between_ending_comma_and_closing_bracket=False | ||
225 | |||
226 | # Split before arguments | ||
227 | split_all_comma_separated_values=False | ||
228 | |||
229 | # Split before arguments if the argument list is terminated by a | ||
230 | # comma. | ||
231 | split_arguments_when_comma_terminated=True | ||
232 | |||
233 | # Set to True to prefer splitting before '+', '-', '*', '/', '//', or '@' | ||
234 | # rather than after. | ||
235 | split_before_arithmetic_operator=False | ||
236 | |||
237 | # Set to True to prefer splitting before '&', '|' or '^' rather than | ||
238 | # after. | ||
239 | split_before_bitwise_operator=True | ||
240 | |||
241 | # Split before the closing bracket if a list or dict literal doesn't fit on | ||
242 | # a single line. | ||
243 | split_before_closing_bracket=True | ||
244 | |||
245 | # Split before a dictionary or set generator (comp_for). For example, note | ||
246 | # the split before the 'for': | ||
247 | # | ||
248 | # foo = { | ||
249 | # variable: 'Hello world, have a nice day!' | ||
250 | # for variable in bar if variable != 42 | ||
251 | # } | ||
252 | split_before_dict_set_generator=True | ||
253 | |||
254 | # Split before the '.' if we need to split a longer expression: | ||
255 | # | ||
256 | # foo = ('This is a really long string: {}, {}, {}, {}'.format(a, b, c, d)) | ||
257 | # | ||
258 | # would reformat to something like: | ||
259 | # | ||
260 | # foo = ('This is a really long string: {}, {}, {}, {}' | ||
261 | # .format(a, b, c, d)) | ||
262 | split_before_dot=False | ||
263 | |||
264 | # Split after the opening paren which surrounds an expression if it doesn't | ||
265 | # fit on a single line. | ||
266 | split_before_expression_after_opening_paren=False | ||
267 | |||
268 | # If an argument / parameter list is going to be split, then split before | ||
269 | # the first argument. | ||
270 | split_before_first_argument=False | ||
271 | |||
272 | # Set to True to prefer splitting before 'and' or 'or' rather than | ||
273 | # after. | ||
274 | split_before_logical_operator=False | ||
275 | |||
276 | # Split named assignments onto individual lines. | ||
277 | split_before_named_assigns=True | ||
278 | |||
279 | # Set to True to split list comprehensions and generators that have | ||
280 | # non-trivial expressions and multiple clauses before each of these | ||
281 | # clauses. For example: | ||
282 | # | ||
283 | # result = [ | ||
284 | # a_long_var + 100 for a_long_var in xrange(1000) | ||
285 | # if a_long_var % 10] | ||
286 | # | ||
287 | # would reformat to something like: | ||
288 | # | ||
289 | # result = [ | ||
290 | # a_long_var + 100 | ||
291 | # for a_long_var in xrange(1000) | ||
292 | # if a_long_var % 10] | ||
293 | split_complex_comprehension=True | ||
294 | |||
295 | # The penalty for splitting right after the opening bracket. | ||
296 | split_penalty_after_opening_bracket=300 | ||
297 | |||
298 | # The penalty for splitting the line after a unary operator. | ||
299 | split_penalty_after_unary_operator=10000 | ||
300 | |||
301 | # The penalty of splitting the line around the '+', '-', '*', '/', '//', | ||
302 | # ``%``, and '@' operators. | ||
303 | split_penalty_arithmetic_operator=300 | ||
304 | |||
305 | # The penalty for splitting right before an if expression. | ||
306 | split_penalty_before_if_expr=0 | ||
307 | |||
308 | # The penalty of splitting the line around the '&', '|', and '^' | ||
309 | # operators. | ||
310 | split_penalty_bitwise_operator=300 | ||
311 | |||
312 | # The penalty for splitting a list comprehension or generator | ||
313 | # expression. | ||
314 | split_penalty_comprehension=80 | ||
315 | |||
316 | # The penalty for characters over the column limit. | ||
317 | split_penalty_excess_character=7000 | ||
318 | |||
319 | # The penalty incurred by adding a line split to the unwrapped line. The | ||
320 | # more line splits added the higher the penalty. | ||
321 | split_penalty_for_added_line_split=30 | ||
322 | |||
323 | # The penalty of splitting a list of "import as" names. For example: | ||
324 | # | ||
325 | # from a_very_long_or_indented_module_name_yada_yad import (long_argument_1, | ||
326 | # long_argument_2, | ||
327 | # long_argument_3) | ||
328 | # | ||
329 | # would reformat to something like: | ||
330 | # | ||
331 | # from a_very_long_or_indented_module_name_yada_yad import ( | ||
332 | # long_argument_1, long_argument_2, long_argument_3) | ||
333 | split_penalty_import_names=0 | ||
334 | |||
335 | # The penalty of splitting the line around the 'and' and 'or' | ||
336 | # operators. | ||
337 | split_penalty_logical_operator=300 | ||
338 | |||
339 | # Use the Tab character for indentation. | ||
340 | use_tabs=False | ||