Skip to content
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

Add runtime and static type checks #639

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

Flova
Copy link
Member

@Flova Flova commented Dec 20, 2024

Summary

Many of our typehints are wrong. This adds beartype based type checks during runtime and static mypy checks to prevent this.

Proposed changes

  • Add beartype
  • Fix errors
  • Fit unrelated crash in animation ui that made testing hard.
  • Add mypy base tests

This adds some risk, as it might lead to a less frequently visited code part with a minor type error crashing our codebase during a game. We could downgrade the errors to warnings, but then they might not be noticed/ignored. We could also deactivate them during real games, but we do not have a mechanic to check for this yet.

We need to test this on the real robot before merging it!

Checklist

  • Run colcon build
  • Write documentation
  • Test on your machine
  • Test on the robot
  • Create issues for future work
  • Triage this PR and label it

@Flova Flova changed the title Add runtime type checks Add runtime and static type checks Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

1 participant