Josverl / micropython-stubs

Stubs of most MicroPython ports, boards and versions to make writing code that much simpler.
https://micropython-stubs.readthedocs.io
MIT License
133 stars 21 forks source link

QA testing with mypy #739

Closed Josverl closed 6 months ago

Josverl commented 6 months ago

This PR adds mypy to the QA test matrix.

It uses the same typecheck framework setup for pyright in order to be able to compare the results side by side.

As the output formats are very different , the mypy output is converted into the same json schema as used by pyright so that the same filtering logic can be used to remove false positives using : # stubs-ignore: linter == "mypy" and similar expressions.

A few test snippets have been adjusted wrt to syntax ( # type ignore # with some other comments) that are not accepted by mypy and a few improvent to the snippets have been made where mypy has stricter pre-conditions.

Signed-off-by: Jos Verlinde jos_verlinde@hotmail.com