Skip to content

fix: name should be optional among all guide functions#27

Merged
Ki-Seki merged 2 commits intomainfrom
Ki-Seki/issue22
Sep 21, 2025
Merged

fix: name should be optional among all guide functions#27
Ki-Seki merged 2 commits intomainfrom
Ki-Seki/issue22

Conversation

@Ki-Seki
Copy link
Member

@Ki-Seki Ki-Seki commented Sep 21, 2025

Fixes #22

@Ki-Seki Ki-Seki requested a review from Copilot September 21, 2025 03:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR makes the name parameter optional across all guide functions to maintain consistency. It also adds proper validation for the choices parameter in the options method.

  • Makes name parameter optional (default None) for person_name, phone_number, e_mail, and single_word methods
  • Makes choices parameter optional in options method and adds validation to ensure it's not empty
  • Maintains consistent API design across all guide functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 243 to 245
def options(self, name: str | None = None, choices: list[str] | None = None) -> MaskedTag:
"""Choose one from the given options."""
if choices is None or len(choices) == 0:
Copy link

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

Making choices optional with a default of None creates an inconsistent API. The choices parameter is fundamental to the options method's functionality and should remain required. Consider keeping it as choices: list[str] to maintain clarity about required parameters.

Suggested change
def options(self, name: str | None = None, choices: list[str] | None = None) -> MaskedTag:
"""Choose one from the given options."""
if choices is None or len(choices) == 0:
def options(self, name: str | None = None, choices: list[str]) -> MaskedTag:
"""Choose one from the given options."""
if len(choices) == 0:

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Ki-Seki Ki-Seki merged commit c0cd50f into main Sep 21, 2025
1 check passed
@Ki-Seki Ki-Seki deleted the Ki-Seki/issue22 branch September 21, 2025 03:17
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.

fix: name should be optional among all guide functions

2 participants