Skip to content

Commit f012470

Browse files
committed
update
1 parent 84c32ea commit f012470

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

gendiff/formaters/stylish.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ def format_value(value, depth):
22
indent = " " * (depth * 4)
33

44
if isinstance(value, dict):
5-
formatted = ["{"]
5+
lines = ["{"]
66
for k, v in value.items():
7-
formatted.append(
8-
f"{indent} {k}: {format_value(v, depth + 1)}"
9-
)
10-
formatted.append(f"{indent}}}")
11-
return "\n".join(formatted)
7+
lines.append(f"{indent} {k}: {format_value(v, depth + 1)}")
8+
lines.append(f"{indent}}}")
9+
return "\n".join(lines)
1210

1311
if value is True:
1412
return "true"
@@ -17,7 +15,8 @@ def format_value(value, depth):
1715
if value is None:
1816
return "null"
1917

20-
return f" {value}"
18+
return str(value)
19+
2120

2221

2322
def format_stylish(diff, depth=0):

0 commit comments

Comments
 (0)