-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dvc: handle multiline command as list #5194
Conversation
Implements an approach proposed by @skshetry. Fixes iterative#4373
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What were the recent motivations for this? π Anyway, this is good.
@@ -47,7 +47,7 @@ def warn_if_fish(executable): | |||
|
|||
def _enforce_cmd_list(cmd): | |||
assert cmd | |||
return cmd if isinstance(cmd, list) else [cmd] | |||
return cmd if isinstance(cmd, list) else cmd.splitlines() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor thing: What should we do in the dvc.lock
file? Should we keep them in a single format (like either a list or a multiline?)? Just that when the user changes the multiline string to a list or vice versa, it should not affect the lock file.
It might be too much to support that way, but just saying that in principle, it'd be better to have a single format in the lock file, but I think it happens rarely in practice and the list and the multiline string might never be equivalent when user refactors them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just addressing your point that we should handle multiline as a list, so we could close that ticket π |
Please note that I closed iterative/dvc.org#2721 as stale but I understand that's not something that has been released (per iterative/dvc.org#2721 (comment)) right? thanks |
Implements an approach proposed by @skshetry.
Fixes #4373
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
iterative/dvc.org#2071
Thank you for the contribution - we'll try to review it as soon as possible. π