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()