Adding a --dir option to give directory through command line
For detailed discussion https://github.com/coala/coala-quickstart/issues/90#issuecomment-304633761 The --dir option to receive current project directory as command line argument.
@hemangsk , why add --dir instead of setting the desired directory as the actual working directory?
I am worried that adding this feature in quickstart, without first implementing the feature in coala-ci, will unearth a few hidden bugs in coala , where assumptions about the current directory relative to the config and the OS current working directory.
Also, as a general thought --dir is too generic an argument name, as coala already has --bears-dir which is aliased to -d.
@jayvdb actually earlier I was thinking that this option would be good as an enhancement to quickstart.
assumptions about the current directory relative to the config and the OS current working directory
Understood, we'd need to plan this feature in coala -ci first, and then move the design towards quickstart.
Setting the desired directory as the actual working directory
I found the cwd option available for subprocess, to change working directory.
For this particular use case where I have to run coala-quickstart, inside web services, doing
cmd = "coala-quickstart --ci --allow-partial-sections"
shell_output, shell_err = run_shell_command(cmd, cwd=directory_name)
is entirely solving the purpose 🎉 . Thanks a lot!
Understood, we'd need to plan this feature in coala -ci first, and then move the design towards quickstart.
Yea, I can see this being a useful feature for coala generally, but the tests will be much more useful, as it will provide a very useful way to verify that the current directory handling is working properly. c.f. https://github.com/coala/coala/issues/3867 for an example of one of the problems in this area that is concerning me. I am glad to hear that you've found a workaround for this problem.
Lets create a task over in the coala repo...