diff --git a/black.py b/black.py index f283ffc99b3..d8aa3562d8f 100644 --- a/black.py +++ b/black.py @@ -1321,7 +1321,7 @@ def contains_uncollapsable_type_comments(self) -> bool: if leaf_id not in ignored_ids or comment_seen: return True - comment_seen = True + comment_seen = True return False diff --git a/tests/data/comments2.py b/tests/data/comments2.py index 54b7b0018c9..248552c12aa 100644 --- a/tests/data/comments2.py +++ b/tests/data/comments2.py @@ -146,6 +146,7 @@ def inline_comments_in_brackets_ruin_everything(): ], ) +CONFIG_FILES = [CONFIG_FILE, ] + SHARED_CONFIG_FILES + USER_CONFIG_FILES # type: Final ####################### ### SECTION COMMENT ### @@ -313,6 +314,8 @@ def inline_comments_in_brackets_ruin_everything(): ) +CONFIG_FILES = [CONFIG_FILE] + SHARED_CONFIG_FILES + USER_CONFIG_FILES # type: Final + ####################### ### SECTION COMMENT ### #######################