Remove first parameter to Run#85
Open
azimux wants to merge 1 commit into
Open
Conversation
azimux
commented
Jul 1, 2026
| end | ||
|
|
||
| When "we pass a file by entrypoint" do | ||
| @run_command = Taylor::Commands::Run.new("--entrypoint", ["--entrypoint", "test/test.rb"], Taylor::Config.new) |
Contributor
Author
There was a problem hiding this comment.
This also shows the confusion. It's a strange interface/contract to tell the calling code "whatever is the first argv, you must also passed as the first argument." As mentioned, there's never a command in this position, either. It's just an arbitrary requirement to duplicate the data there. This also happens in other tests below.
azimux
commented
Jul 1, 2026
|
|
||
| When "we pass specify arguments for the entrypoint via -- without any options for the command" do | ||
| @run_command = Taylor::Commands::Run.new( | ||
| "--", |
Contributor
Author
There was a problem hiding this comment.
Same thing here. It's a confusing interface to be required to pass "--" twice, both times representing an argv entry, and not representing a command at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the Change?
This removes the first parameter to
Run. It's redundant with a misleading name so this reduces confusion. This was extracted from the "--" PR to make that simpler but wanted to open a PR with that commit for re-consideration in isolation from the other changes.The command parameter doesn't actually represent a command. A more descriptive name would be something like
working_directory_or_entry_point_or_switch_of_first_cli_optionthough obviously too long so a shorter name for that would be something likefirst_arg. Theargvparameter already contains this along with other args. Exposing this through Run's public interface imposes this confusion on the calling code such that it has to know to always pass the first argv as both the first parameter toRunas well as the first element of the second parameter toRunotherwise things don't work. And calling itcommandinstead offirst_argincreases the confusion.Checklist
^ Technically just updated existing tests that were added in the PR this was extracted from
migrations/0_4_to_0_5.mdif it's a breaking changechangelog.md^ Seems like for an internal interface change like this there's probably not much value of adding it to the changelog but can if desired of course.
dx/exec bundle exec rake ci^ running this command locally doesn't seem to do anything useful.