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

Improve static type checking #201

Open
callahad opened this issue Apr 2, 2021 · 3 comments
Open

Improve static type checking #201

callahad opened this issue Apr 2, 2021 · 3 comments

Comments

@callahad
Copy link
Contributor

callahad commented Apr 2, 2021

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/

@aitorres
Copy link
Contributor

aitorres commented Apr 2, 2021

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

callahad pushed a commit that referenced this issue Apr 23, 2021
babolivier pushed a commit that referenced this issue May 25, 2021
* Improve static type checking

Add type annotation to is_too_long Function on apnstruncate.py file
as part of #201 issue

Signed-off-by: Omar Mohamed <[email protected]>
callahad pushed a commit that referenced this issue Jun 7, 2021
Add type annotation to truncate Function on apnstruncate.py file
as part of #201 issue

Signed-off-by: Omar Mohamed <[email protected]>
@dklimpel
Copy link
Contributor

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]

@DMRobertson
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants