-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: the codebase has type hints but we do not check them in the CI pipeline. Solution: add a type check step with mypy. Fixed the following issues: - the generate/publish steps now check for exceptions before returning instead of checking in the next function. This allows to simplify the type hints for return values. - The response hash/random bytes are now split in published/unpublished versions to ensure that the message hash is present in the API responses.
- Loading branch information
1 parent
e833fab
commit 36282b7
Showing
11 changed files
with
207 additions
and
72 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
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,65 @@ | ||
# Global options: | ||
|
||
[mypy] | ||
mypy_path = src | ||
|
||
exclude = conftest.py | ||
|
||
|
||
show_column_numbers = True | ||
|
||
# Suppressing errors | ||
# Shows errors related to strict None checking, if the global strict_optional flag is enabled | ||
strict_optional = True | ||
no_implicit_optional = True | ||
|
||
# Import discovery | ||
# Suppresses error messages about imports that cannot be resolved | ||
ignore_missing_imports = True | ||
# Forces import to reference the original source file | ||
no_implicit_reexport = True | ||
# show error messages from unrelated files | ||
follow_imports = silent | ||
follow_imports_for_stubs = False | ||
|
||
|
||
# Disallow dynamic typing | ||
# Disallows usage of types that come from unfollowed imports | ||
disallow_any_unimported = False | ||
# Disallows all expressions in the module that have type Any | ||
disallow_any_expr = False | ||
# Disallows functions that have Any in their signature after decorator transformation. | ||
disallow_any_decorated = False | ||
# Disallows explicit Any in type positions such as type annotations and generic type parameters. | ||
disallow_any_explicit = False | ||
# Disallows usage of generic types that do not specify explicit type parameters. | ||
disallow_any_generics = False | ||
# Disallows subclassing a value of type Any. | ||
disallow_subclassing_any = False | ||
|
||
# Untyped definitions and calls | ||
# Disallows calling functions without type annotations from functions with type annotations. | ||
disallow_untyped_calls = False | ||
# Disallows defining functions without type annotations or with incomplete type annotations | ||
disallow_untyped_defs = False | ||
# Disallows defining functions with incomplete type annotations. | ||
check_untyped_defs = False | ||
# Type-checks the interior of functions without type annotations. | ||
disallow_incomplete_defs = False | ||
# Reports an error whenever a function with type annotations is decorated with a decorator without annotations. | ||
disallow_untyped_decorators = False | ||
|
||
# Prohibit comparisons of non-overlapping types (ex: 42 == "no") | ||
strict_equality = True | ||
|
||
# Configuring warnings | ||
# Warns about unneeded # type: ignore comments. | ||
warn_unused_ignores = True | ||
# Shows errors for missing return statements on some execution paths. | ||
warn_no_return = True | ||
# Shows a warning when returning a value with type Any from a function declared with a non- Any return type. | ||
warn_return_any = False | ||
|
||
# Miscellaneous strictness flags | ||
# Allows variables to be redefined with an arbitrary type, as long as the redefinition is in the same block and nesting level as the original definition. | ||
allow_redefinition = 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
Oops, something went wrong.