Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Aug 26, 2025

This pull request focuses on improving type safety and robustness across the codebase by updating type annotations, handling potential None values, and making minor refactors for clarity. The changes primarily affect the handling of optional values, type hints, and error handling, especially in service, controller, and utility modules.

Type annotation improvements and None handling:

  • Updated type hints throughout the codebase from legacy list and dict annotations (e.g., [dict]) to modern Python type hints (e.g., list[dict], dict | list), improving code clarity and type checking. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Adjusted controller logic to handle None values more gracefully by defaulting to empty strings or lists when necessary, reducing the risk of runtime errors. [1] [2] [3] [4] [5]

Service and API client updates:

  • Refactored SwitcherClient and related service methods to use the correct certificate path variable and improved the verification logic for HTTP requests. [1] [2]
  • Updated GraphQL method signatures for clarity and consistency, including renaming parameters for better readability.

Controller and view logic refactoring:

  • Refactored controller functions to ensure variables are initialized before try/except blocks and to improve the clarity of argument collection. [1] [2] [3] [4] [5]
  • Improved utility function signatures to include explicit return types, aiding static analysis and readability.

Testing improvements:

  • Updated test fixtures and mocks to use new type annotations, ensuring consistency with the main codebase and preventing type-related test failures. [1] [2] [3] [4]

These changes collectively enhance code maintainability, reduce the likelihood of type-related bugs, and improve developer experience with clearer type expectations.

@petruki petruki self-assigned this Aug 26, 2025
@sonarqubecloud
Copy link

@petruki petruki merged commit 1e531ed into master Aug 26, 2025
5 checks passed
@petruki petruki deleted the staging branch August 26, 2025 07:05
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