Skip to content

Require values for shell list arguments#1492

Open
biefan wants to merge 1 commit intoAzure:mainfrom
biefan:require-values-for-shell-list-args
Open

Require values for shell list arguments#1492
biefan wants to merge 1 commit intoAzure:mainfrom
biefan:require-values-for-shell-list-args

Conversation

@biefan
Copy link
Contributor

@biefan biefan commented Mar 17, 2026

Summary

  • require at least one value for list-style pyrit_shell run arguments
  • prevent empty-value flags from silently degrading into empty lists or fallback behavior
  • add regression coverage for all list-style shell run flags

Problem

Several list-style run arguments currently accept zero values:

  • --initializers
  • --initialization-scripts
  • --env-files
  • --strategies / -s
  • --dataset-names

When that happens, parse_run_arguments() returns an empty list and keeps parsing the rest of the command.

That creates silent misconfiguration paths such as:

  • run demo --initializers --max-retries 2
  • run demo --env-files --database InMemory
  • run demo --dataset-names --max-dataset-size 5

In shell mode this is especially misleading because the command is accepted even though the user explicitly provided an incomplete flag.

Testing

  • .venv/bin/pytest tests/unit/cli/test_frontend_core.py -q
  • .venv/bin/pytest tests/unit/cli/test_pyrit_shell.py -q -k parse_error

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.

2 participants