mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-02 08:22:52 +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:
parent
831787619a
commit
6088b0cff5
73 changed files with 442 additions and 175 deletions
|
|
@ -5,13 +5,15 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import typing as t
|
||||
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
|
||||
class ModuleHelperException(Exception):
|
||||
def __init__(self, msg, update_output=None, *args, **kwargs):
|
||||
self.msg = to_native(msg or f"Module failed with exception: {self}")
|
||||
def __init__(self, msg: str, update_output: dict[str, t.Any] | None = None, *args, **kwargs):
|
||||
self.msg: str = to_native(msg or f"Module failed with exception: {self}")
|
||||
if update_output is None:
|
||||
update_output = {}
|
||||
self.update_output = update_output
|
||||
self.update_output: dict[str, t.Any] = update_output
|
||||
super(ModuleHelperException, self).__init__(*args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue