Don't put four empty lines between top-level functions split by a comment
This commit is contained in:
parent
7ad9445caf
commit
b9c06a0d23
@ -269,6 +269,9 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md).
|
||||
|
||||
* remove a trailing comma if there is a single argument to a call
|
||||
|
||||
* if top level functions were separated by a comment, don't put four
|
||||
empty lines after the upper function
|
||||
|
||||
* fixed missing space in numpy-style array indexing (#33)
|
||||
|
||||
* fixed spurious space after star-based unary expressions (#31)
|
||||
|
4
black.py
4
black.py
@ -628,6 +628,10 @@ def maybe_empty_lines(self, current_line: Line) -> Tuple[int, int]:
|
||||
(two on module-level), as well as providing an extra empty line after flow
|
||||
control keywords to make them more prominent.
|
||||
"""
|
||||
if current_line.is_comment:
|
||||
# Don't count standalone comments towards previous empty lines.
|
||||
return 0, 0
|
||||
|
||||
before, after = self._maybe_empty_lines(current_line)
|
||||
self.previous_after = after
|
||||
self.previous_line = current_line
|
||||
|
Loading…
Reference in New Issue
Block a user