mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-08 14:22:56 +00:00
Improve typing (#911)
* Make type checking more strict. * mypy: warn about unreachable code. * Enable warn_redundant_casts. * Enable strict_bytes. * Look at some warn_return_any warnings.
This commit is contained in:
@@ -440,7 +440,7 @@ def main() -> t.NoReturn:
|
||||
module.fail_json(
|
||||
msg=f"tls_ctx_options must be a string or integer, got {tls_ctx_option!r}"
|
||||
)
|
||||
tls_ctx_option_int = (
|
||||
tls_ctx_option_int = ( # type: ignore[unreachable]
|
||||
0 # make pylint happy; this code is actually unreachable
|
||||
)
|
||||
|
||||
@@ -558,7 +558,7 @@ def main() -> t.NoReturn:
|
||||
elif x509.version == cryptography.x509.Version.v3:
|
||||
result["version"] = 3 - 1
|
||||
else:
|
||||
result["version"] = "unknown"
|
||||
result["version"] = "unknown" # type: ignore[unreachable]
|
||||
|
||||
if verified_chain is not None:
|
||||
result["verified_chain"] = verified_chain
|
||||
|
||||
Reference in New Issue
Block a user