Skip to content

Commit 9e2ac5a

Browse files
committed
better list formatting
1 parent a02ed0d commit 9e2ac5a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/somesy/pyproject/writer.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,15 @@ def _set_property(self, key: Union[str, List[str], IgnoreKey], value: Any) -> No
9494
if key not in curr:
9595
curr.add(key, tomlkit.table())
9696
curr = curr[key]
97-
curr[key_path[-1]] = value
97+
98+
# Handle arrays with proper formatting
99+
if isinstance(value, list):
100+
array = tomlkit.array()
101+
array.extend(value)
102+
array.multiline(True) # Ensure consistent multiline formatting
103+
curr[key_path[-1]] = array
104+
else:
105+
curr[key_path[-1]] = value
98106

99107

100108
class Poetry(PyprojectCommon):

0 commit comments

Comments
 (0)