-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more type annotations and improve MonkeyType tooling (#600)
* Apply monkeytype to twine.repository * Clean up after monkeytype * Apply monkeytype to twine.utils * Clean up after monkeytype * Apply monkeytype to twine.package * Clean up after monkeytype * Apply monkeytype to twine.auth * Clean up after monkeytype * Add annotations to twine.settings * Add monkeytype to tox * Apply monkeytype to twine.cli * Clean up after monkeytype * Add TODOs to mypy config * Enable strict settings that already pass * Fix incomplete defs * Fix untyped defs * Fix any generics * Fix return any * Add comment re: subclassing any
- Loading branch information
1 parent
2c30b1e
commit 8765d14
Showing
8 changed files
with
105 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,32 @@ | ||
[mypy] | ||
; TODO: check_untyped_defs = True | ||
; TODO: Make this more granular; docs recommend it as a "last resort" | ||
; https://mypy.readthedocs.io/en/latest/existing_code.html#start-small | ||
; https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-type-hints-for-third-party-library | ||
ignore_missing_imports = True | ||
; NOTE: Docs recommend `normal` or `silent` for an existing codebase | ||
; https://mypy.readthedocs.io/en/latest/running_mypy.html#following-imports | ||
; follow_imports = skip | ||
|
||
warn_redundant_casts = True | ||
warn_unused_configs = True | ||
warn_unused_ignores = True | ||
|
||
; Reporting | ||
show_traceback = True | ||
html_report = mypy | ||
linecount_report = mypy | ||
lineprecision_report = mypy | ||
txt_report = mypy | ||
|
||
; TODO: Adopt --strict settings, iterating towards something like: | ||
; https://github.com/pypa/packaging/blob/master/setup.cfg | ||
; Starting with modules that have annotations applied via MonkeyType | ||
[mypy-twine.auth,twine.cli,twine.package,twine.repository,twine.utils] | ||
; Enabling this will fail on subclasses of untype imports, e.g. tqdm | ||
; disallow_subclassing_any = True | ||
disallow_any_generics = True | ||
disallow_untyped_calls = True | ||
disallow_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
check_untyped_defs = True | ||
disallow_untyped_decorators = True | ||
no_implicit_optional = True | ||
warn_return_any = True | ||
no_implicit_reexport = True | ||
strict_equality = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters