Skip to content

Feat/issue 808 cli input validation#950

Merged
steam-bell-92 merged 2 commits into
steam-bell-92:mainfrom
Shashank-8p:feat/issue-808-cli-input-validation
Jun 1, 2026
Merged

Feat/issue 808 cli input validation#950
steam-bell-92 merged 2 commits into
steam-bell-92:mainfrom
Shashank-8p:feat/issue-808-cli-input-validation

Conversation

@Shashank-8p
Copy link
Copy Markdown
Contributor

📝 Description

Resolves critical ValueError crashes across the Python CLI applications by standardizing user input handling.

Architectural Changes Implemented:

  • Centralized Validation: Discovered and integrated the pre-existing utils/validation.py module into the CLI games (e.g., Number-Sliding-Puzzle.py).
  • Crash Prevention: Replaced raw int(input()) and localized, redundant try-except blocks with get_int() and get_yes_no(). These utilities enforce infinite retry loops, ensuring the application gracefully handles non-numeric or empty inputs without hard-crashing.
  • Code Reduction: Removed boilerplate validation logic from individual game scripts, reducing technical debt and improving maintainability.

🔗 Linked Issue

Closes #808


📋 Contribution Checklist

  • My code strictly adheres to the project guidelines.
  • I have tested the changes locally by attempting to input invalid data (e.g., letters instead of numbers) and verified the application recovers gracefully.
  • GSSoC 2026: I have been formally assigned to this issue and noted it above.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@Shashank-8p is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

@steam-bell-92 steam-bell-92 merged commit 9240c83 into steam-bell-92:main Jun 1, 2026
9 of 10 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

🎉 Thank you for your contribution!

Your Pull Request has been merged successfully.

We appreciate the time and effort you put into improving this project. Contributions like yours help the repository grow and stay useful for everyone.

If you'd like to contribute again, please check the open issues and make sure you are assigned before opening another Pull Request.

Thanks again for your support! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: CLI scripts crash with ValueError on non-numeric inputs

2 participants