Skip to content

fix: make the input location optional in the run command - #2207

Open
NoiceHax wants to merge 1 commit into
aboutcode-org:mainfrom
NoiceHax:fix/issue-2203
Open

fix: make the input location optional in the run command#2207
NoiceHax wants to merge 1 commit into
aboutcode-org:mainfrom
NoiceHax:fix/issue-2203

Conversation

@NoiceHax

Copy link
Copy Markdown

Issues

Changes

The run command always required an input location, so a pipeline that takes no input could only be started with run <pipeline> "".

input_location is now declared with nargs="?". Since argparse gives every positional value to the nargs="+" pipelines list, the trailing value is moved to input_location only when it is not an available pipeline name. The input options are built only when a location was given, so a pipeline that does need an input fails during its own execution instead of at argument parsing.

Added a test that runs a pipeline with no input and checks that a trailing pipeline name is not read as an input location. Updated the existing test for the new "arguments are required" message, and the CLI docs.

I could not run the Django test suite locally, since it needs the Docker and PostgreSQL stack. I ran ruff check, ruff format --check, doc8 on the changed docs page, and a standalone script that replays the positional split for every run invocation used in the existing tests.

AI disclosure: I used Claude Code while writing this patch.

Checklist

  • I have read the contributing guidelines
  • I have linked an existing issue above
  • I have added unit tests covering the new code
  • I have reviewed and understood every line of this PR

The run command always required an input location, so pipelines that do
not take any input could only be started by passing an empty string.

The input location is now optional. The trailing positional value is only
treated as an input when it is not an available pipeline name, and the
input options are only built when a location was provided.

Signed-off-by: NoiceHax <yashasprakash021@gmail.com>
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.

update run cli command to run pipelines without an input

1 participant