Skip to content

fix(mypy): Linter fixes#553

Merged
amilcarlucas merged 1 commit into
masterfrom
lint_fixes2
Jun 12, 2025
Merged

fix(mypy): Linter fixes#553
amilcarlucas merged 1 commit into
masterfrom
lint_fixes2

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

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: ignore comments, refining type annotations, and simplifying test cases.

Improvements to type annotations:

  • Removed # type: ignore[misc] comments from the methods __get_settings_as_dict, __set_settings_from_dict, and __get_settings_config in backend_filesystem_program_settings.py, as they are no longer necessary. [1] [2]
  • Updated the variable serial_list in __auto_detect_serial to explicitly declare its type as list[mavutil.SerialPort] in backend_flightcontroller.py.

Code refactoring:

  • Renamed the variable size to size_int in __handle_list_reply to clarify its purpose and improve readability in backend_mavftp.py.

Test cleanup:

  • Removed redundant test assertions verifying specific paths in test_fc_connection_type_paths_structure in test_data_model_vehicle_components_validation_constants.py, as the general pattern validation already ensures correctness.

Copilot AI review requested due to automatic review settings June 12, 2025 21:13
@amilcarlucas amilcarlucas merged commit 2decb54 into master Jun 12, 2025
14 of 17 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (sizesize_int) and logging in backend_mavftp.py
  • Dropped obsolete # type: ignore comments and added explicit type annotation for serial_list in 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_int includes a type suffix; for clearer intent, consider renaming it to something like file_size or parsed_size.
size_int = int(size)

@amilcarlucas amilcarlucas deleted the lint_fixes2 branch June 12, 2025 21:14
@github-actions
Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
6807 4649 68% 60% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/backend_filesystem_program_settings.py 84% 🟢
ardupilot_methodic_configurator/backend_flightcontroller.py 41% 🟢
TOTAL 63% 🟢

updated for commit: 66ee6f8 by action🐍

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