Skip to content

Commit

Permalink
Cherry pick psf#4028.
Browse files Browse the repository at this point in the history
This keeps two blank lines between the module docstring and the following def/class when there are no other code in between.

Why cherrypick not rebase? Pyink is not yet ready to rebase to Black 23.11.0 yet, I'm waiting for psf#4012 to be merged as Pyink has local patches related by hugging parens.

PiperOrigin-RevId: 582472645
  • Loading branch information
yilei authored and copybara-github committed Nov 15, 2023
1 parent 5edc4e2 commit 447741e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/pyink/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ def maybe_empty_lines(self, current_line: Line) -> LinesBlock:
and self.previous_block.previous_block is None
and len(self.previous_block.original_line.leaves) == 1
and self.previous_block.original_line.is_triple_quoted_string
and not (current_line.is_class or current_line.is_def)
):
before = 1

Expand Down

0 comments on commit 447741e

Please sign in to comment.