Add typing information, 1/2 (#1176)

* Re-enable typing and improve config.

* Make mypy pass.

* Improve settings.

* First batch of types.

* Add more type hints.

* Fixes.

* Format.

* Fix split_port() without returning to previous type chaos.

* Continue with type hints (and ignores).
This commit is contained in:
Felix Fontein
2025-10-23 07:05:42 +02:00
committed by GitHub
parent 24f35644e3
commit 3350283bcc
92 changed files with 4366 additions and 2272 deletions
+12 -4
View File
@@ -7,17 +7,25 @@
# disallow_untyped_defs = True -- for later
# strict = True -- only try to enable once everything (including dependencies!) is typed
# strict_equality = True -- for later
# strict_bytes = True -- for later
strict_equality = True
strict_bytes = True
# warn_redundant_casts = True -- for later
warn_redundant_casts = True
# warn_return_any = True -- for later
# warn_unreachable = True -- for later
warn_unreachable = True
[mypy-ansible.*]
# ansible-core has partial typing information
follow_untyped_imports = True
[mypy-docker.*]
# Docker SDK for Python has partial typing information
follow_untyped_imports = True
[mypy-ansible_collections.community.internal_test_tools.*]
# community.internal_test_tools has no typing information
ignore_missing_imports = True
[mypy-jsondiff.*]
# jsondiff has no typing information
ignore_missing_imports = True