From 714af8bc27034bd4af1bf9ed862573be4d860b56 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 10 Dec 2022 08:45:40 -0800 Subject: [PATCH] empty_lines_before_class_or_def_with_leading_comments --- src/black/lines.py | 4 +--- src/black/mode.py | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/black/lines.py b/src/black/lines.py index 08281bc..9963bc9 100644 --- a/src/black/lines.py +++ b/src/black/lines.py @@ -628,9 +628,7 @@ def _maybe_empty_lines_for_class_or_def( ): slc = self.semantic_leading_comment if ( - Preview.empty_lines_before_class_or_def_with_leading_comments - in current_line.mode - and slc is not None + slc is not None and slc.previous_block is not None and not slc.previous_block.original_line.is_class and not slc.previous_block.original_line.opens_block diff --git a/src/black/mode.py b/src/black/mode.py index db54b57..136f5c5 100644 --- a/src/black/mode.py +++ b/src/black/mode.py @@ -149,7 +149,6 @@ def supports_feature(target_versions: Set[TargetVersion], feature: Feature) -> b class Preview(Enum): """Individual preview style features.""" - empty_lines_before_class_or_def_with_leading_comments = auto() handle_trailing_commas_in_head = auto() long_docstring_quotes_on_newline = auto() normalize_docstring_quotes_and_prefixes_properly = auto()