Skip to content

Commit

Permalink
Fix TOML array formatting (#1084)
Browse files Browse the repository at this point in the history
Closes #1083

A trailing newline is only added if there are dependencies or comments
in the array.
  • Loading branch information
my1e5 authored May 15, 2024
1 parent 43ac3a3 commit 3dfdcdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rye/src/utils/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ pub fn reformat_array_multiline(deps: &mut Array) {
rv.push_str(comment);
}
}
rv.push('\n');
if !rv.is_empty() || !deps.is_empty() {
rv.push('\n');
}
rv
});
deps.set_trailing_comma(true);
Expand Down

0 comments on commit 3dfdcdb

Please sign in to comment.