-
Notifications
You must be signed in to change notification settings - Fork 229
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
[Feature] Static Type Checking With ament_mypy #1257
Comments
@InvincibleRMC 1st of all, really appreciate all the contribution you have been and are making for we expected that this feature request would come up. i think that this will be better consistent and readable for sure, but that is gonna be the work and a long run. i also would like to hear from more opinion here. let's keep this open to get more feedback! |
@fujitatomoya The current default for ament_mypy doesn't include |
We can discuss this, but we'll need to discuss with the whole community. Changing this default will affect all packages (though looking through the packages released into Rolling, there are only maybe a dozen that use
This is pretty straightforward, so I would suggest starting there. |
Feature request
Feature description
Using
ament_mypy
to assure future code has proper typing annotations. First and foremost this change would need to wait on many pull requests as there are over 100 mypy errors still remaining on rolling. This change would also likely require any upstream dependencies to adoptament_mypy
to avoid[no-untyped-call]
error and other similar errors being raised from a new upstream function being added and called. I bring up this question now so if this feature is desired I can start getting those upstream dependencies checked withament_mypy
earlier to avoid future waiting. For CI time considerationsament_mypy
runs in about 2.4s. The benefits of this would be improved code readability, helping catch unexpected edge cases, as well remove the need for downstream dependencies who type check to suppress[no-untyped-call]
and other similar errors whenever using rclpy.Implementation considerations
For implementation currently only
ament_mypy
exists. The alternative would be perhaps creating anament_pyright
and using that instead for static type checking.If this is a feature the maintainers are willing to support I will gladly help accomplish this goal. And if anyone else wants to help test with
ament_mypy
or add type annotations torclpy
or any other ROS2 python file that would be greatly appreciated.The text was updated successfully, but these errors were encountered: