Formatter: Insert newline after comments

This commit is contained in:
gregorni 2023-08-15 17:48:56 +02:00
parent 8c4eebba08
commit 441a7a38bd

View file

@ -67,7 +67,10 @@ class Format:
tokenized_str += item_as_string
if item_as_string in NEWLINE_AFTER:
if (
item_as_string in NEWLINE_AFTER
or item.type == tokenizer.TokenType.COMMENT
):
tokenized_str += "\n" + (indent_levels * " ")
elif item_as_string in WHITESPACE_AFTER:
tokenized_str += " "