X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/e818260f1a223929d8f2056f484b73eaa8687622..2057bf6faef88b23273d7dd0c2f366ee8284314a:/black.py diff --git a/black.py b/black.py index 7dc6ef8..dc67991 100644 --- a/black.py +++ b/black.py @@ -989,14 +989,11 @@ class Line: @property def is_triple_quoted_string(self) -> bool: - """Is the line a triple quoted docstring?""" + """Is the line a triple quoted string?""" return ( bool(self) and self.leaves[0].type == token.STRING - and ( - self.leaves[0].value.startswith('"""') - or self.leaves[0].value.startswith("'''") - ) + and self.leaves[0].value.startswith(('"""', "'''")) ) def contains_standalone_comments(self, depth_limit: int = sys.maxsize) -> bool: @@ -1257,9 +1254,8 @@ class EmptyLineTracker: if self.previous_line.is_decorator: return 0, 0 - if ( - self.previous_line.is_class - and self.previous_line.depth != current_line.depth + if self.previous_line.depth < current_line.depth and ( + self.previous_line.is_class or self.previous_line.is_def ): return 0, 0