X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/02f81c6995db4688baedd3c63e4b9821c090f09c..38723bb7787d50f8751fad2eaa48b52c9e94c18d:/src/black/lines.py?ds=inline diff --git a/src/black/lines.py b/src/black/lines.py index 9d33bfa..ea8fe52 100644 --- a/src/black/lines.py +++ b/src/black/lines.py @@ -28,6 +28,7 @@ from black.nodes import ( is_multiline_string, is_one_sequence_between, is_type_comment, + is_type_ignore_comment, is_with_or_async_with_stmt, replace_child, syms, @@ -251,7 +252,7 @@ class Line: for comment in comments: if is_type_comment(comment): if comment_seen or ( - not is_type_comment(comment, " ignore") + not is_type_ignore_comment(comment) and leaf_id not in ignored_ids ): return True @@ -288,7 +289,7 @@ class Line: # line. for node in self.leaves[-2:]: for comment in self.comments.get(id(node), []): - if is_type_comment(comment, " ignore"): + if is_type_ignore_comment(comment): return True return False @@ -634,6 +635,8 @@ class EmptyLineTracker: and self.previous_line.is_class and current_line.is_triple_quoted_string ): + if Preview.no_blank_line_before_class_docstring in current_line.mode: + return 0, 1 return before, 1 if self.previous_line and self.previous_line.opens_block: