mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Formatter: Add trailing commas in lists
This commit is contained in:
parent
55e5095fba
commit
b9f58aeab5
7 changed files with 59 additions and 4 deletions
|
@ -146,8 +146,10 @@ def format(data, tab_size=2, insert_space=True):
|
|||
is_child_type = False
|
||||
|
||||
elif str_item in CLOSING_TOKENS:
|
||||
if str_item == "]" and last_not_whitespace != ",":
|
||||
if str_item == "]" and str(last_not_whitespace) != "[":
|
||||
current_line = current_line[:-1]
|
||||
if str(last_not_whitespace) != ",":
|
||||
current_line += ","
|
||||
commit_current_line()
|
||||
current_line = "]"
|
||||
elif str(last_not_whitespace) in OPENING_TOKENS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue