Closed sisp closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.71%. Comparing base (
dd2b515
) to head (4503a4e
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@sisp I personally find offset 2 more readable, but I'm hesitant to approve this for a couple reasons:
ruamel.yaml
defaults. Maybe it is something you could take up with them?dvc.yaml
files.Thanks for your feedback, @dberenbaum! :pray:
I could raise this topic upstream, but if they agree than the result for DVC will be the same – a reformatting of YAML(-like) files but potentially even unrelated to any DVC release since ruamel.yaml
's version is only lower-bounded (which is good!):
https://github.com/iterative/dvc/blob/dd2b515c97a6757c6c3522329d6259e0e86592df/pyproject.toml#L67
I agree with Dave here. I would not change the format w/o a very strong reason (some other tool defaults probably is not strong enough imo).
Also - should it be configurable (we won't be able to serve everyone), also should DVC try to preserve the existing formatting (this is probably not easy)?
DVC already preserves formatting of yaml files. The stylistic choices are only applied when dvc creates a new file. In that case, you are better using pre-commit hooks.
I am -1 on adding any configuration.
@sisp Thanks for the PR, but I am going to close this one since the team agrees this is not something we want to handle in dvc.
Fair enough, @dberenbaum.
Just a minor esthetics change: I've updated the indentation settings for YAML serialization to align better with common formatting styles.
YAML is often formatted with a 2 spaces offset for lists. For instance, Prettier formats it like this, and
dvc.yaml
file examples in the DVC docs also use this formatting style.Also,
ruamel.yaml
's documentation states:[x] ❗ I have followed the Contributing to DVC checklist.
[x] 📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.