Skip to content

Code simplification and pyright linter fixes#409

Merged
amilcarlucas merged 2 commits into
masterfrom
lint_fixes
Apr 21, 2025
Merged

Code simplification and pyright linter fixes#409
amilcarlucas merged 2 commits into
masterfrom
lint_fixes

Conversation

@amilcarlucas
Copy link
Copy Markdown
Collaborator

@amilcarlucas amilcarlucas commented Apr 21, 2025

This pull request focuses on improving code readability and simplifying logic in the ardupilot_methodic_configurator module, as well as cleaning up test files by removing redundant pylint suppressions. The key changes include replacing unnecessary conditional checks, streamlining tooltip logic, and refining test code.

Code readability and logic simplification:

  • Simplified the retrieval of doc_tooltip in __update_table by using a default value directly in the get method, removing redundant conditional checks (ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.py, ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.pyL185-R188).
  • Removed unnecessary conditional checks for param_metadata in __create_parameter_name and __create_unit_label, directly using default values in the get method (ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.py, [1] [2].

Test file cleanup:

  • Removed redundant pylint suppression comments, such as invalid-name, where they were no longer necessary (tests/test_frontend_tkinter_template_overview.py, tests/test_frontend_tkinter_template_overview.pyL25-R27).
  • Cleaned up test methods by removing pylint suppressions from mock private method assignments, improving consistency across the test suite (tests/test_frontend_tkinter_template_overview.py, [1] [2] [3].

Copilot AI review requested due to automatic review settings April 21, 2025 00:57
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 simplifies code and addresses pyright linter warnings by updating pylint directive usage and streamlining parameter metadata access.

  • Updated pylint disable/enable comments in test_frontend_tkinter_template_overview.py
  • Simplified parameter metadata retrieval in frontend_tkinter_parameter_editor_table.py
  • Removed redundant conditional checks by utilizing default values with dict.get

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/test_frontend_tkinter_template_overview.py Adjusted pylint directives and removed unnecessary inline suppression comments for private method naming
ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.py Simplified retrieval of parameter metadata and tooltips by using dict.get default values

@amilcarlucas amilcarlucas merged commit b359b21 into master Apr 21, 2025
18 of 20 checks passed
@amilcarlucas amilcarlucas deleted the lint_fixes branch April 21, 2025 01:35
@github-actions
Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
6134 4027 66% 60% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/frontend_tkinter_parameter_editor_table.py 41% 🟢
TOTAL 41% 🟢

updated for commit: 31d3f1b 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