Skip to content

refactor: improve GitHub issue counter readability and error handling#2015

Open
pradipgirhe wants to merge 1 commit into
MunGell:mainfrom
pradipgirhe:refactor/improve-cli-code
Open

refactor: improve GitHub issue counter readability and error handling#2015
pradipgirhe wants to merge 1 commit into
MunGell:mainfrom
pradipgirhe:refactor/improve-cli-code

Conversation

@pradipgirhe
Copy link
Copy Markdown

@pradipgirhe pradipgirhe commented May 15, 2026

Description

Summary

Refactored the GitHub issue counter CLI to improve code readability, maintainability, and API request handling.

Changes Made

  • Added BASE_URL constant for cleaner API management
  • Refactored query creation into a separate build_query() function
  • Replaced manual URL concatenation with params=params
  • Added timeout handling for API requests
  • Added response.raise_for_status() for improved HTTP error handling
  • Improved overall code structure and readability
  • Fixed typo-related issue in error handling

Benefits

  • Cleaner and more maintainable code
  • Better separation of concerns
  • Improved reliability for API requests
  • More production-ready CLI structure

Testing

Tested successfully using:

python3 cghi.py microsoft vscode

Output example:

Open issues found: 15591

Fixes #2014

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.

refactor: Refactor GitHub Issue Counter CLI for Better Error Handling and Code Readability

1 participant