-
Notifications
You must be signed in to change notification settings - Fork 109
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
Type annotate code via mypy (strict) typechecking all flake8-bugbear code #478
Comments
There's a couple nasty things that need restructuring before we can add a loose mypy run, in particular the magic with namedtuple+partial for I'd suggest doing something similar to how we do it in flake8-async, https://github.com/python-trio/flake8-async/blob/c977a2e8d471d474ef13ca9b746acdd63600ea52/flake8_async/base.py#L62 I love having types when developing, so whenever I contribute I don't mind adding types for whatever my contribution touches. |
Thanks for calling this out. I expected this. I've never had a code base where adding typing has not unlocked some evil evil code. That's it's main advantage, if typing is hard, probably not the cleanest code. Many thanks for the example. I'll try copy it if I get to this. I'm due for some actual code changes here. Thanks for adding typing as you add new features + fix bugs. Goal 1: Try get mypy running on minimum typed code and iteratively work from there. |
I added basic mypy checking in #482. I converted all the BNNN.abcd assignments to separate globals and annotated a bunch of instance attributes; otherwise it was mostly smooth sailing. |
I added a few more types in #483. Here's a few next steps to take:
I might do a few of those things at some point but no guarantees. Others should feel free to put up incremental PRs too. |
We should add type hinting everywhere across the code.
Happy for gradual, but eventually working up to mypy strict typing.
The text was updated successfully, but these errors were encountered: