Skip to content

refactor: convert utilities projects to follow procedural guidelines#817

Merged
steam-bell-92 merged 4 commits into
steam-bell-92:mainfrom
mrdeyroy:fix/utilities-projects-guidelines
May 27, 2026
Merged

refactor: convert utilities projects to follow procedural guidelines#817
steam-bell-92 merged 4 commits into
steam-bell-92:mainfrom
mrdeyroy:fix/utilities-projects-guidelines

Conversation

@mrdeyroy
Copy link
Copy Markdown
Contributor

Description

This PR refactors all Python CLI scripts in the utilities/ directory to adhere to the project's strict procedural guidelines (no functions or classes, emoji-based CLI output, robust input validation, and replay loops).

Fixes :

#804

Changes Made

  • F1 Performance Analyzer: Removed functions (fetch_f1_data, display_standings, display_constructors, main) and inlined sequential logic. Swapped external requests dependency for standard urllib.request to comply with the "No External Dependencies" rule. Wrapped in a while True: loop.
  • Number System Converter: Removed all helper conversion functions and inlined the logic directly in choice blocks. Wrapped in a while True: loop.
  • Tower of Hanoi: Converted helper rendering/movement functions to procedural inlined logic inside a stack-based solver and replay loop.
  • Typing Speed Tester: Converted logic to be purely procedural, inlining the random phrase API calls (with offline list fallbacks) and wrapping it in a replay loop.
  • Tests Update: Rewrote tests/test_number_system_converter.py to use unittest and test the CLI interactions using subprocess.Popen to ensure full test coverage for the procedural implementation.

Verification Results

All 125 tests executed and passed successfully:

python -m unittest discover -s tests -v

📋 Contribution Checklist

  • My code strictly adheres to the project guidelines (Standard library only, procedural code, clean spacing).
  • I have verified that my files are placed in the correct directory.
  • I have tested my changes thoroughly on my local machine.
  • I have included interactive emojis and clean console/UI outputs.
  • GSSoC 2026: I have been formally assigned to this issue and noted it above.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

@mrdeyroy is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Comment thread utilities/F1-Performance-Analyzer/F1-Performance-Analyzer.py Fixed
Comment thread utilities/F1-Performance-Analyzer/F1-Performance-Analyzer.py Fixed
@steam-bell-92 steam-bell-92 merged commit af4dc6d into steam-bell-92:main May 27, 2026
8 of 9 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants