PTHMINT-41: Fix error ANN003 occurences#13
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request improves type annotations for better code clarity and maintainability while updating linting configuration to enforce stricter rules. The key changes include:
- Refining type annotations in the init methods of the Listing and CustomApiResponse classes.
- Updating the pyproject.toml file to remove the ANN003 ignore rule so that annotation errors are caught.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/multisafepay/api/base/response/custom_api_response.py | Added explicit dict[str, Any] type for **kwargs in the init method to improve clarity. |
| src/multisafepay/api/base/listings/listing.py | Refined type annotations in the init method, using list[Any] and dict[str, Any] for improved precision. |
| pyproject.toml | Removed the ANN003 rule from the ignore list to enforce stricter type annotation guidelines. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #13 +/- ##
=======================================
Coverage 90.75% 90.75%
=======================================
Files 106 106
Lines 2305 2305
=======================================
Hits 2092 2092
Misses 213 213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 includes updates to type annotations and configuration files to improve code clarity and maintainability. The most important changes involve refining type hints in constructors and updating the
pyproject.tomlfile to adjust linting rules.Type annotation improvements:
src/multisafepay/api/base/listings/listing.py: Updated the__init__method in theListingclass to use more precise type annotations, includinglist[Any]for thedataparameter anddict[str, Any]for**kwargs.src/multisafepay/api/base/response/custom_api_response.py: Modified the__init__method in theCustomApiResponseclass to includedict[str, Any]as the type for**kwargs.Configuration updates:
pyproject.toml: Removed theANN003rule from theignorelist, ensuring stricter adherence to type annotation guidelines.