From e268cbaf668cc86b1e6aa52e52483cf4592e176c Mon Sep 17 00:00:00 2001 From: Yurii Karabas <1998uriyyo@gmail.com> Date: Wed, 26 Aug 2020 13:43:00 +0300 Subject: [PATCH] Revert contains_pragma_comment function changes --- src/black/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/black/__init__.py b/src/black/__init__.py index 96dd0e4..f51a50d 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -4444,10 +4444,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]: -- 2.39.5