mirror of
https://gitlab.com/qemu-project/meson.git
synced 2025-09-16 14:41:54 +08:00
mformat: force multiline arguments with comma
Force multiline arguments when there is a trailing comma. This is the behavior of muon. Fixes #14721.
This commit is contained in:

committed by
Eli Schwartz

parent
70b0de49f6
commit
0188454717
@ -242,6 +242,10 @@ class MultilineArgumentDetector(FullAstVisitor):
|
||||
if node.is_multiline:
|
||||
self.is_multiline = True
|
||||
|
||||
nargs = len(node)
|
||||
if nargs and nargs == len(node.commas):
|
||||
self.is_multiline = True
|
||||
|
||||
if self.is_multiline:
|
||||
return
|
||||
|
||||
|
@ -92,3 +92,11 @@ if meson.project_version().version_compare('>1.2')
|
||||
# comment
|
||||
endif
|
||||
endif
|
||||
|
||||
# Test for trailing comma:
|
||||
m = [1, 2, 3]
|
||||
n = [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
]
|
||||
|
Reference in New Issue
Block a user