X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/4ca92ac91c944b252caf8c2265e5854f839a66f4..7fe19fac5bccc08dbcf21c293ab50f1fcda7716f:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index 96dd0e4..34d8145 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -2049,7 +2049,6 @@ class LineGenerator(Visitor[Line]): if leaf.value[tail_len + 1] == docstring[-1]: docstring = docstring + " " leaf.value = leaf.value[0:lead_len] + docstring + leaf.value[tail_len:] - normalize_string_quotes(leaf) yield from self.visit_default(leaf) @@ -4444,10 +4443,11 @@ def contains_pragma_comment(comment_list: List[Leaf]) -> bool: of the more common static analysis tools for python (e.g. mypy, flake8, pylint). """ - return any( - comment.value.startswith(("# type:", "# noqa", "# pylint:")) - for comment in comment_list - ) + for comment in comment_list: + if comment.value.startswith(("# type:", "# noqa", "# pylint:")): + return True + + return False def insert_str_child_factory(string_leaf: Leaf) -> Callable[[LN], None]: