Skip to content

Commit f51262a

Browse files
committed
Add no split option
1 parent a20ac8f commit f51262a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mamushi/formatting/format.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ def format_tree(ast: Node, max_line_length: int = 80) -> str:
1414
dst_contents.append(str(empty_line) * after)
1515
before, after = elt.maybe_empty_lines(current_line)
1616
dst_contents.append(str(empty_line) * before)
17-
for line in split_line(current_line, line_length=max_line_length):
18-
dst_contents.append(str(line))
17+
if "# nosplit" in str(current_line):
18+
dst_contents.append(str(current_line))
19+
else:
20+
for line in split_line(current_line, line_length=max_line_length):
21+
dst_contents.append(str(line))
1922

2023
return "".join(dst_contents)

0 commit comments

Comments
 (0)