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.

330 lines
9.9 KiB

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