All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 # Test for https://github.com/psf/black/issues/246.
4 # This comment should be split from the statement above by two lines.
10 # This multiline comments section
11 # should be split from the statement
18 # This comment should be split from the statement above by two lines.
19 async def async_function():
24 # This comment should be split from the statement above by two lines.
30 # This should be stick to the statement above
32 # This should be split from the above by two lines
33 class MyClassWithComplexLeadingComments:
37 class ClassWithDocstring:
39 # Leading comment after a class with just a docstring
40 class MyClassAfterAnotherClassWithDocstring:
49 @deco2(with_args=True)
61 @deco2(with_args=True)
63 # leading 3 that already has an empty line
66 def decorated_with_split_leading_comments():
74 @deco2(with_args=True)
78 # leading 4 that already has an empty line
79 def decorated_with_split_leading_comments():
85 # Leading comment before inline function
88 # Another leading comment
92 # More leading comments
93 def inline_after_else():
98 # Leading comment before "top-level inline" function
99 def top_level_quote_inline():
101 # Another leading comment
102 def another_top_level_quote_inline_inline():
105 # More leading comments
106 def top_level_quote_inline_after_else():
111 # First method has no empty lines between bare class def.
113 def first_method(self):
117 # Regression test for https://github.com/psf/black/issues/3454.
120 # Trailing comment that belongs to this function
124 @decorator2 # fmt: skip
129 # Regression test for https://github.com/psf/black/issues/3454.
132 # Trailing comment that belongs to this function.
133 # NOTE this comment only has one empty line below, and the formatter
134 # should enforce two blank lines.
137 # A standalone comment
145 # Test for https://github.com/psf/black/issues/246.
150 # This comment should be split from the statement above by two lines.
158 # This multiline comments section
159 # should be split from the statement
160 # above by two lines.
168 # This comment should be split from the statement above by two lines.
169 async def async_function():
176 # This comment should be split from the statement above by two lines.
182 # This should be stick to the statement above
185 # This should be split from the above by two lines
186 class MyClassWithComplexLeadingComments:
190 class ClassWithDocstring:
194 # Leading comment after a class with just a docstring
195 class MyClassAfterAnotherClassWithDocstring:
206 @deco2(with_args=True)
220 @deco2(with_args=True)
222 # leading 3 that already has an empty line
225 def decorated_with_split_leading_comments():
235 @deco2(with_args=True)
239 # leading 4 that already has an empty line
240 def decorated_with_split_leading_comments():
246 # Leading comment before inline function
250 # Another leading comment
251 def another_inline():
255 # More leading comments
256 def inline_after_else():
261 # Leading comment before "top-level inline" function
262 def top_level_quote_inline():
265 # Another leading comment
266 def another_top_level_quote_inline_inline():
270 # More leading comments
271 def top_level_quote_inline_after_else():
276 # First method has no empty lines between bare class def.
278 def first_method(self):
282 # Regression test for https://github.com/psf/black/issues/3454.
285 # Trailing comment that belongs to this function
289 @decorator2 # fmt: skip
294 # Regression test for https://github.com/psf/black/issues/3454.
297 # Trailing comment that belongs to this function.
298 # NOTE this comment only has one empty line below, and the formatter
299 # should enforce two blank lines.
303 # A standalone comment