Skip to content

Remove first parameter to Run#85

Open
azimux wants to merge 1 commit into
HellRok:mainfrom
azimux:remove-first-parameter-to-run-command
Open

Remove first parameter to Run#85
azimux wants to merge 1 commit into
HellRok:mainfrom
azimux:remove-first-parameter-to-run-command

Conversation

@azimux

@azimux azimux commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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_option though obviously too long so a shorter name for that would be something like first_arg. The argv parameter 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 to Run as well as the first element of the second parameter to Run otherwise things don't work. And calling it command instead of first_arg increases the confusion.

Checklist

  • Added tests

^ Technically just updated existing tests that were added in the PR this was extracted from

  • Added documentation
  • Updated migrations/0_4_to_0_5.md if it's a breaking change
  • Added an entry to changelog.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.

  • Run dx/exec bundle exec rake ci

^ running this command locally doesn't seem to do anything useful.

end

When "we pass a file by entrypoint" do
@run_command = Taylor::Commands::Run.new("--entrypoint", ["--entrypoint", "test/test.rb"], Taylor::Config.new)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


When "we pass specify arguments for the entrypoint via -- without any options for the command" do
@run_command = Taylor::Commands::Run.new(
"--",

@azimux azimux Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

1 participant