Skip to content
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

Default setting for directory in wflow_start? #252

Open
pcarbo opened this issue Jun 22, 2021 · 4 comments
Open

Default setting for directory in wflow_start? #252

pcarbo opened this issue Jun 22, 2021 · 4 comments

Comments

@pcarbo
Copy link
Member

pcarbo commented Jun 22, 2021

I'm wondering if it would make sense to set the default for directory in wflow_start to getwd(), or something like that.

@rgayler
Copy link

rgayler commented Jun 24, 2021

My 2c worth - I would leave it as a mandatory argument because it's possibly safer to have the user explicitly think about where they want it.

For getwd() to be reasonable the user needs to have already created a directory and setwd() to it. In which case, wflow_start() isn't the start, it's two commands after the start.

If the user hasn't created a directory and setwd() to it, then wflow_start()using the current directory is probably a mistake.

@pcarbo
Copy link
Member Author

pcarbo commented Jun 24, 2021

Thanks @rgayler.

@jdblischak
Copy link
Member

@pcarbo Thanks for proposing the idea and @rgayler for weighing in. Below are my thoughts:

There are 2 main use cases for wflow_start():

  1. Creating a new workflowr project (existing = FALSE, the default)
  2. Adding the workflowr infrastructure to an existing project (existing = TRUE). While the rarer use case, it is definitely encouraged, e.g. we have an entire vingette dedicated to migrating existing projects

If we changed the argument to have a default, e.g. directory = ".", this would have the following impact:

  1. For the first use case, I don't see it as very helpful, for the same reasons that @rgayler mentioned above. For the correct usage, the user would need to first create the new directory manually and then change directories. Thus I don't think it is saving any time. For the incorrect usage, I worry about new users running wflow_start(), then getting an error message, and then accidentally running wflow_start(existing = TRUE), which would create a .git directory, likely in their home directory.
  2. For the use case of converting an existing project, this would shorten the command from wflow_start(".", existing = TRUE) to wflow_start(existing = TRUE). Personally this doesn't seem worth it to me. It would require lengthening the documentation for the argument directory of wflow_start(), which is possibly the first documentation that new users will read.

@pcarbo Is the directory argument a pain point in your usage and/or have you observed this as a stumbling block for other users?

@pcarbo
Copy link
Member Author

pcarbo commented Jun 24, 2021

These are all fair points. I thought it seemed like a simple improvement but I didn't consider all the use cases. Feel free to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants