1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-28 14:39:07 +00:00

CI: add type checking (#10997)

* Set up type checking with mypy.

* Make mypy pass.

* Use list() instead of sorted().
This commit is contained in:
Felix Fontein 2025-10-29 18:13:38 +01:00 committed by GitHub
parent 831787619a
commit 6088b0cff5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
73 changed files with 442 additions and 175 deletions

View file

@ -164,7 +164,7 @@ IS_PYTHON_2 = sys.version_info[0] <= 2
class JenkinsNode:
def __init__(self, module):
def __init__(self, module: AnsibleModule) -> None:
self.module = module
self.name = module.params['name']
@ -174,7 +174,7 @@ class JenkinsNode:
self.url = module.params['url']
self.num_executors = module.params['num_executors']
self.labels = module.params['labels']
self.offline_message = module.params['offline_message'] # type: str | None
self.offline_message: str | None = module.params['offline_message']
if self.offline_message is not None:
self.offline_message = self.offline_message.strip()