Skip to content

Commit

Permalink
fix: rename split param to no_tail
Browse files Browse the repository at this point in the history
  • Loading branch information
tconbeer committed Jan 26, 2023
1 parent 75d831a commit 02fc97f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sqlfmt/splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def maybe_split(self, line: Line) -> List[Line]:
new_lines.append(line)
else:
new_line, comments = self.split_at_index(
line, head, i, comments, is_tail=True
line, head, i, comments, no_tail=True
)
assert (
not comments
Expand All @@ -55,7 +55,7 @@ def maybe_split(self, line: Line) -> List[Line]:

always_split_after, never_split_after = self.maybe_split_after(node)

new_line, comments = self.split_at_index(line, head, -1, comments, is_tail=True)
new_line, comments = self.split_at_index(line, head, -1, comments, no_tail=True)
assert not comments, "Comments must be empty here or we'll drop them"
new_lines.append(new_line)
return new_lines
Expand Down Expand Up @@ -130,7 +130,7 @@ def split_at_index(
head: int,
index: int,
comments: List[Comment],
is_tail: bool = False,
no_tail: bool = False,
) -> Tuple[Line, List[Comment]]:
"""
Return a new line comprised of the nodes line[head:index], plus a newline node.
Expand All @@ -147,7 +147,7 @@ def split_at_index(

assert new_nodes, "Cannot split a line without nodes!"

if is_tail:
if no_tail:
head_comments, tail_comments = comments, []
elif comments:
if new_nodes[0].is_comma:
Expand Down

0 comments on commit 02fc97f

Please sign in to comment.