forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 27
Add Ruff and Basedpyright linters to (the newer) Python scripts in Mbed #520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
tools/python/mbed_tools/devices/_internal/windows/component_descriptor.py
Show resolved
Hide resolved
tools/python/mbed_tools/targets/_internal/targets_json_parsers/accumulating_attribute_parser.py
Show resolved
Hide resolved
27ff3cd to
9626898
Compare
VictorWTang
reviewed
Nov 30, 2025
tools/python/mbed_tools/devices/_internal/windows/component_descriptor.py
Show resolved
Hide resolved
tools/python/mbed_tools/devices/_internal/windows/windows_identifier.py
Outdated
Show resolved
Hide resolved
tools/python/mbed_tools/devices/_internal/windows/system_data_loader.py
Outdated
Show resolved
Hide resolved
VictorWTang
approved these changes
Dec 2, 2025
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.
Summary of changes
This PR adds some linting support for the Python scripts in Mbed. It might seem like a small thing, but I believe linters like Ruff and pyright are a great way to catch small mistakes before they become a problem (especially in a language like Python that lets you play it fast and loose with types). I don't really expect to catch bugs in the existing scripts, as those have been working for some time, but I really want to have the linter available when making my own changes and additions to these scripts down the road.
Note that for now I only added the linters to the newest python scripts, the
mbed_toolsandmbed_platformiopackages. The old scripts are largely deprecated and don't have any type annotations, so I feel like linting those would be a significant uphill battle, and I'd want to prune out a lot of the unused ones first.Impact of changes
@overridedecorator now have it (and their arguments are made to match exactly with the base class function)Migration actions required
Documentation
Pull request type
Test results