You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

339 lines
10 KiB

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