Skip to content

Commit

Permalink
Add no split option
Browse files Browse the repository at this point in the history
  • Loading branch information
benber86 committed Dec 29, 2024
1 parent a20ac8f commit f51262a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mamushi/formatting/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def format_tree(ast: Node, max_line_length: int = 80) -> str:
dst_contents.append(str(empty_line) * after)
before, after = elt.maybe_empty_lines(current_line)
dst_contents.append(str(empty_line) * before)
for line in split_line(current_line, line_length=max_line_length):
dst_contents.append(str(line))
if "# nosplit" in str(current_line):
dst_contents.append(str(current_line))
else:
for line in split_line(current_line, line_length=max_line_length):
dst_contents.append(str(line))

return "".join(dst_contents)

0 comments on commit f51262a

Please sign in to comment.