Skip to content

Refactor: Update method names and add PEP 257 docstrings#22

Open
Aryan-Shastri wants to merge 2 commits into
softwareconstruction240:mainfrom
Aryan-Shastri:fix/issue-20-method-names
Open

Refactor: Update method names and add PEP 257 docstrings#22
Aryan-Shastri wants to merge 2 commits into
softwareconstruction240:mainfrom
Aryan-Shastri:fix/issue-20-method-names

Conversation

@Aryan-Shastri
Copy link
Copy Markdown

@Aryan-Shastri Aryan-Shastri commented Jun 4, 2026

Overview

This PR addresses Issue #20 by refactoring excessively long, Copilot-generated method names and introducing standard PEP 257 docstrings to core functions to improve maintainability.

Changes Made

  • Method Renaming: Refactored _update_student_name_if_longer ➡️ _update_student_name (db.py).
    • Refactored require_queue_open_and_not_in_queue ➡️ can_join_queue (ui/helpers/queue_helpers.py).
  • Documentation: Added structured docstrings to undocumented database functions (e.g., increment_help, record_bot_issue, get_times_helped_today) and helper functions.
  • Reference Updates: Updated all internal calls and references to the renamed methods across the codebase to ensure routing remains fully functional.

Testing

  • Verified that renamed symbols map correctly across all files.
  • No changes were made to the core logic, ensuring existing queue and database functionalities remain intact.

@Aryan-Shastri Aryan-Shastri changed the title Refactor: Update method names and add PEP 257 docstrings (Fixes #20) Refactor: Update method names and add PEP 257 docstrings Jun 4, 2026
@TwoLettuce
Copy link
Copy Markdown
Contributor

Hey @Aryan-Shastri, thanks for contributing!

I'd like to see more than just a few methods changed by this PR. Hopefully, a PR addressing #20 would completely resolve that issue, and yours is helping only in part. If you'd like us to merge your PR, I ask that you continue making changes like the ones that you've already made. bot.py stands out as a particular offender of this issue.

Copy link
Copy Markdown
Contributor

@TwoLettuce TwoLettuce left a comment

Choose a reason for hiding this comment

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

See above

@Aryan-Shastri
Copy link
Copy Markdown
Author

Thanks for the feedback! You are absolutely right. I will dive into bot.py now, apply the same refactoring and documentation standards, and push the updates to this PR shortly.

@Aryan-Shastri
Copy link
Copy Markdown
Author

Just pushed the updates! I refactored the verbose message-fetching methods in bot.py and added the missing PEP 257 docstrings to the core Bot class and handler. Let me know how it looks!

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