-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
typing: add type checks for the first module
This change is the beginning of fully annotating Aiven Client. Install mypy, add mypy config file with everything ignored, except for the one module, add target to Makefile, enable checks in GitHub Actions. Partial implementation of #258.
- Loading branch information
Roman Inflianskas
committed
Jan 17, 2022
1 parent
2f6b8bb
commit 63f1ad8
Showing
8 changed files
with
43 additions
and
8 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 |
---|---|---|
|
@@ -38,6 +38,9 @@ jobs: | |
- id: flake8 | ||
run: make flake8 | ||
|
||
- id: mypy | ||
run: make mypy | ||
|
||
- id: pyLint | ||
run: make pylint | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from pkgutil import extend_path | ||
|
||
__path__ = extend_path(__path__, __name__) | ||
__path__ = extend_path(__path__, __name__) # type: ignore # mypy issue #1422 |
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,7 +1,8 @@ | ||
from .cli import AivenCLI | ||
from typing import NoReturn | ||
|
||
|
||
def main(): | ||
def main() -> NoReturn: | ||
AivenCLI().main() | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Global configuration | ||
|
||
[mypy] | ||
python_version = 3.7 | ||
warn_redundant_casts = True | ||
|
||
# Disable errors on the code which is not annotated yet | ||
|
||
[mypy-aiven.client.*] | ||
ignore_errors = True | ||
|
||
[mypy-tests.*] | ||
ignore_errors = True | ||
|
||
[mypy-aiven.client.__main__] | ||
ignore_errors = False | ||
disallow_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
check_untyped_defs = True | ||
no_implicit_optional = True | ||
warn_unused_ignores = True | ||
warn_no_return = True | ||
warn_unreachable = True | ||
strict_equality = True | ||
ignore_missing_imports = 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