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

Consider running in CI a static type checker like mypy #190

Open
diegoferigo opened this issue Jun 28, 2024 · 2 comments
Open

Consider running in CI a static type checker like mypy #190

diegoferigo opened this issue Jun 28, 2024 · 2 comments

Comments

@diegoferigo
Copy link
Member

The jaxsim package is widely type hinted, however at the moment it's only useful while developing for IDE suggestions. It would be great if, slowly, we can start having mypy running at least on the jaxsim.api package.

The starting point is not that easy. I get ~200 errors.

@diegoferigo diegoferigo changed the title Consider running in CI a type checker like mypy Consider running in CI a static type checker like mypy Jun 28, 2024
@flferretti
Copy link
Collaborator

Some people are working to implement a static type checker in ruff as documented in astral-sh/ruff#3893. The main progresses can be tracked in the red knot https://github.com/astral-sh/ruff/tree/main/crates/red_knot or at astral-sh/ruff#11653.

After trying some alternatives, I've found pyright to be easier to understand and use than mypy. Nevertheless, a faster and even clearer alternative could be pylyzer, whose logging output is similar to the one reported by ruff. The only drawback is that the installation requires cargo as the version on PyPI cannot install ERG

@diegoferigo
Copy link
Member Author

Awesome, if ruff gains support of a static type checker, it'd be great exploiting it. We don't need many features, something quite basic could work at least in the beginning.

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

No branches or pull requests

2 participants