PTHMINT-45 Fix ruff error code ANN201 #16
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces type annotations to several methods across the codebase, enhancing type safety and improving code readability. It also includes minor adjustments to imports and configuration files. Below is a categorized summary of the most important changes:
Type Annotations for Methods
Added return type annotations to various methods, such as
appendinlisting.py,get_dataincustom_api_response.py, andadd_statusincapture_request.py. These changes ensure that method return types are explicit and consistent. [1] [2] [3]Updated methods in
checkout_data.pyto include return type annotations, such asadd_items,get_items, andget_item_by_merchant_item_id, improving clarity in the refund request components. [1] [2] [3]Added type annotations to validators in value object models like
ApiKey,Country, andCurrency, ensuring that validation methods explicitly returnstr. [1] [2] [3]Configuration and Import Adjustments
Removed the
ANN201rule from theignorelist inpyproject.toml, likely indicating stricter adherence to type annotation rules.Added the
Anytype to imports inapi.pyto support new type annotations.These changes collectively improve the maintainability and robustness of the codebase by making type expectations explicit.