Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Always use trailing newlines in multi line arrays #1596

Closed
vektah opened this issue Jan 29, 2018 · 1 comment
Closed

Always use trailing newlines in multi line arrays #1596

vektah opened this issue Jan 29, 2018 · 1 comment

Comments

@vektah
Copy link

vektah commented Jan 29, 2018

#1461 switched to using multi line toml arrays in the lock file, while this improved readability it also introduced some additional diff churn.

Before:

- packages = [".","a"]
+ packages = [".","a","b"]

After:

packages = [
    "."
-   "a"
+   "a",
+   "b"
]

This is bad because it increases the chance of merge conflicts in the lock and decreases readability. It was also one of the reasons toml was chosen over a more mainstream format like json.

Proposal: Always add trailing commas, just like in go. This probably requires an upstream change to the toml library.

@vektah
Copy link
Author

vektah commented Jan 29, 2018

Sorry, double post of #1595

@vektah vektah closed this as completed Jan 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant