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.

344 lines
10 KiB

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