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

[Feature Request] Add Types to our code #3060

Open
Feverfew opened this issue Dec 20, 2020 · 0 comments
Open

[Feature Request] Add Types to our code #3060

Feverfew opened this issue Dec 20, 2020 · 0 comments

Comments

@Feverfew
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Dynamic languages are cool and all, but make it hard to figure out what possible types there could be statically. This causes countless bugs, especially as our gencache DB is nullable everywhere!

Describe the solution you'd like
Type check all the code, with CI to prevent type-less code!

Describe alternatives you've considered (optional)
Do nothing

Additional context(optional)
This is quite a daunting project, and there are doubts this will be feasible with Django but we need to experiment before we write it off. We should aim to type check the common and uclapi folders first, as a lot of other apps depend on them. After that we can choose whatever is easiest, just so that we get used to it. In addiiton we can use MonkeyType to do a lot of the work for us! We should probably get CI involved quite soon, so it will check all folders that we know are typed, to make sure we don't regress!

https://mypy.readthedocs.io/en/stable/
https://github.com/Instagram/MonkeyType
https://github.com/typeddjango
https://sobolevn.me/2019/08/typechecking-django-and-drf
https://instagram-engineering.com/let-your-code-type-hint-itself-introducing-open-source-monkeytype-a855c7284881
https://instagram-engineering.com/static-analysis-at-scale-an-instagram-story-8f498ab71a0c

@Feverfew Feverfew added this to To do in Type Checking via automation Dec 20, 2020
@Feverfew Feverfew changed the title [BUG] Add Types to our code [Feature Request] Add Types to our code Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant