Skip to content

Fix terminal UI validator stub so interactive prompts actually validate input - #53

Merged
coordt merged 1 commit into
masterfrom
fix/issue-48-terminal-validator
Sep 27, 2026
Merged

coordt merged 1 commit into
masterfrom
fix/issue-48-terminal-validator

Conversation

@coordt

@coordt coordt commented Sep 27, 2026

Copy link
Copy Markdown
Member

Summary

  • make_validator in project_forge/ui/terminal.py returned None unconditionally, so a Question's validator expression was silently discarded and interactive terminal prompts never validated user input.
  • make_validator now wraps the validator callable into the True/error-string contract questionary expects.
  • ask_multiselect was passing validator= instead of validate= to questionary.checkbox, an unrecognized kwarg that questionary silently dropped — fixed to validate=.
  • questionary.select() has no validation hook at all, so ask_select now runs a manual validate-and-reprompt loop instead of passing a dead kwarg.

Test plan

  • uv run pytest tests/test_ui/test_terminal.py -v — 20 passed, including new tests for make_validator, text-prompt rejection wired through questionary's real validator, and select re-prompting on an invalid choice.
  • uv run pytest -q — 334 passed (pre-existing, unrelated test_git_commands.py failures in this sandbox due to git push restrictions).
  • uv run ruff check / ruff format --check on changed files.

Closes #48

…te input

make_validator returned None unconditionally, so a Question's validator
expression was silently ignored in the interactive terminal UI. It now
wraps the validator callable into questionary's True/error-string
contract. Also fixes ask_multiselect passing the wrong kwarg
(`validator=` instead of `validate=`, which questionary.checkbox
ignores), and gives ask_select a manual validate-and-reprompt loop
since questionary.select() has no validation hook of its own.

Closes #48
@github-actions

Copy link
Copy Markdown
Contributor

Version hint: patch
Current version: 0.9.2
New version (when merged): 0.9.3

Comment ID: Display version hint-auto-generated

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-27 13:10 UTC

@coordt
coordt merged commit 317e9de into master Sep 27, 2026
5 checks passed
@coordt
coordt deleted the fix/issue-48-terminal-validator branch September 27, 2026 13:10
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.

make_validator stub means terminal UI never validates question input

1 participant