fix(mypy): Linter fixes#553
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses mypy linting issues by removing unnecessary # type: ignore comments, refining type annotations, renaming a variable for clarity, and cleaning up redundant test assertions.
- Cleaned up test by removing redundant specific-path assertions in
test_fc_connection_type_paths_structure - Refactored variable naming (
size→size_int) and logging inbackend_mavftp.py - Dropped obsolete
# type: ignorecomments and added explicit type annotation forserial_listin backends
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_data_model_vehicle_components_validation_constants.py | Removed redundant assertions for specific FC connection paths |
| ardupilot_methodic_configurator/backend_mavftp.py | Renamed size to size_int and updated logging accordingly |
| ardupilot_methodic_configurator/backend_flightcontroller.py | Removed unnecessary # type: ignore and added list type hint |
| ardupilot_methodic_configurator/backend_filesystem_program_settings.py | Deleted unneeded mypy ignore comments from settings methods |
Comments suppressed due to low confidence (2)
tests/test_data_model_vehicle_components_validation_constants.py:49
- Removing these specific-path assertions reduces targeted coverage for critical FC_CONNECTION_TYPE_PATHS entries; consider reintroducing a focused test to ensure the required paths are present.
# Verify specific required paths exist
ardupilot_methodic_configurator/backend_mavftp.py:486
- [nitpick] The variable name
size_intincludes a type suffix; for clearer intent, consider renaming it to something likefile_sizeorparsed_size.
size_int = int(size)
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
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 several changes aimed at improving code clarity, simplifying type annotations, and cleaning up unused test assertions. The most important changes involve removing unnecessary
# type: ignorecomments, refining type annotations, and simplifying test cases.Improvements to type annotations:
# type: ignore[misc]comments from the methods__get_settings_as_dict,__set_settings_from_dict, and__get_settings_configinbackend_filesystem_program_settings.py, as they are no longer necessary. [1] [2]serial_listin__auto_detect_serialto explicitly declare its type aslist[mavutil.SerialPort]inbackend_flightcontroller.py.Code refactoring:
sizetosize_intin__handle_list_replyto clarify its purpose and improve readability inbackend_mavftp.py.Test cleanup:
test_fc_connection_type_paths_structureintest_data_model_vehicle_components_validation_constants.py, as the general pattern validation already ensures correctness.