sygnal icon indicating copy to clipboard operation
sygnal copied to clipboard

Improve static type checking

Open callahad opened this issue 3 years ago • 3 comments

Running mypy --strict sygnal/ tests/ setup.py returns "634 errors in 27 files". We should start chipping away at that little by little. :)

For an introduction to mypy, see https://mypy.readthedocs.io/

callahad avatar Apr 02 '21 09:04 callahad

I can take a look at this, at least partially, to slowly reduce the amount of type errors

aitorres avatar Apr 02 '21 22:04 aitorres

The current status: mypy --strict sygnal/ tests/

Found 281 errors in 22 files (checked 29 source files)

234 x error: Call to untyped function "(.*)" in typed context [no-untyped-call]

dklimpel avatar Apr 24 '23 14:04 dklimpel

I would guess that a lot of those untyped calls are to twisted functions that lack annotations.

You can add in your own stubs for twisted to suppress these, but in doing so you commit to reannotating everything we use in twisted that is already annotated upstream. I went down that path with sydent, and while it's doable I wouldn't recommend it!

DMRobertson avatar Apr 24 '23 14:04 DMRobertson