jaxsim icon indicating copy to clipboard operation
jaxsim copied to clipboard

Consider running in CI a static type checker like `mypy`

Open diegoferigo opened this issue 1 year ago • 3 comments

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.

  • https://mypy.readthedocs.io/en/stable/index.html

diegoferigo avatar Jun 28 '24 15:06 diegoferigo

Some people are working to implement a static type checker in ruff as documented in https://github.com/astral-sh/ruff/issues/3893. The main progresses can be tracked in the red knot https://github.com/astral-sh/ruff/tree/main/crates/red_knot or at https://github.com/astral-sh/ruff/issues/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

flferretti avatar Aug 26 '24 12:08 flferretti

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.

diegoferigo avatar Aug 26 '24 13:08 diegoferigo

Apparently astral-sh released a preview version of red-knot as ty at https://github.com/astral-sh/ty

flferretti avatar Oct 07 '25 08:10 flferretti