nevinera / quiet_quality

A system for finding and annotating quality issues on your forward diffs
MIT License
12 stars 0 forks source link

Convenient way to _fully run_ one tool #105

Closed nevinera closed 11 months ago

nevinera commented 1 year ago

Frequently, I find myself wishing I could leverage qq to generate and execute a tool's command, but then just take the output from the tool, especially for rspec. I think a command like qq exec rubocop [flags] that uses the usual logic to determine how to run rubocop, but then actually execs the command inline..

Well, there are some details. Some of the flags don't make sense, and the command is actually different, since we don't want json output for these. So probably it should be separate script, like qqe rubocop. And the runners would need to provide a exec_command for use by this tool.

nevinera commented 11 months ago

After starting on this a few times, it's clear that we want to leverage the existing Entrypoint and arg-parsing as far as possible (they're a large fraction of the actual code already). So I'm adding an --exec/-X argument; when supplied, it means "only run this tool, and exec it instead of managing it". That does mean some other arguments and config will get ignored when -X is supplied, which is fine (though we might want to warn the user if they supply it on the command-line with -X?).

It also means that the tool being execced needs to be one of the tools that's expected to run, which we can resolve by adding it the same way it would get added if it were being explicitly listed as a positional argument.