Skip to content

Commit 70b0de4

Browse files
bruchar1eli-schwartz
authored andcommitted
format: do not group '--' arg
The group_arg_value option allow to put --key and its value on the same line on multiline arguments. However, when the options is `--`, it is an argument separator, and should not be grouped with the following argument.
1 parent 84c1791 commit 70b0de4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonbuild/mformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ def visit_ArgumentNode(self, node: mparser.ArgumentNode) -> None:
670670
if self.config.group_arg_value:
671671
for arg in node.arguments[:-1]:
672672
group_args = False
673-
if isinstance(arg, mparser.StringNode) and arg.value.startswith('--'):
673+
if isinstance(arg, mparser.StringNode) and arg.value.startswith('--') and arg.value != '--':
674674
next_arg = node.arguments[arg_index + 1]
675675
if isinstance(next_arg, mparser.StringNode) and not next_arg.value.startswith('--'):
676676
group_args = True

0 commit comments

Comments
 (0)