coala-quickstart icon indicating copy to clipboard operation
coala-quickstart copied to clipboard

Adding a --dir option to give directory through command line

Open hemangsk opened this issue 8 years ago • 3 comments

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 avatar May 31 '17 18:05 hemangsk

@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 avatar Jun 02 '17 17:06 jayvdb

@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!

hemangsk avatar Jun 02 '17 23:06 hemangsk

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...

jayvdb avatar Jun 03 '17 09:06 jayvdb