-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[mypy] Adding mypy type checking #7053
Conversation
c24d741
to
c8cd3af
Compare
Codecov Report
@@ Coverage Diff @@
## master #7053 +/- ##
=======================================
Coverage 64.46% 64.46%
=======================================
Files 421 421
Lines 20537 20537
Branches 2247 2247
=======================================
Hits 13240 13240
Misses 7170 7170
Partials 127 127
Continue to review full report at Codecov.
|
4b7ac67
to
177e7c0
Compare
177e7c0
to
2f02278
Compare
@@ -462,6 +462,35 @@ Note that the test environment uses a temporary directory for defining the | |||
SQLite databases which will be cleared each time before the group of test | |||
commands are invoked. | |||
|
|||
#### Typing | |||
|
|||
To ensure clarity, consistency, all readability, _all_ new functions should use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'm happy with this. Can we kick off a [DISCUSS]
thread on the mailing list though, making sure we have consensus?
LGTM ! |
I'm merging this as I'd like to play around with mypy and add some type annotations to some |
This PR adds
mypy
(courtesy offlake8
) for checking Python type hints. Additionally it updates theCONTRIBUTING.md
to strongly encourage new Python functions to use type hints.Note I corrected some
mypy
issues but ignored others as I don't have full context into the code. Theget_since_until
method seems to be especially problematic partially becausesince
,until
, andrelative_end
are being re-typed in the function (which is probably non-ideal).to: @betodealmeida @michellethomas @mistercrunch @xtinec