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.

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