diff options
author | John L. Villalovos <john@sodarock.com> | 2021-11-06 21:33:07 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-11-08 07:21:17 -0800 |
commit | 7828ba2fd13c833c118a673bac09b215587ba33b (patch) | |
tree | 71312fe159fcc62ace0aeb24be94072ee4cf33cf /gitlab/v4/objects/runners.py | |
parent | 9a2f54cf044929dfc3fd89714ce657fa839e35d0 (diff) | |
download | gitlab-jlvillal/mypy_small_files_1.tar.gz |
chore: enforce type-hints on most files in gitlab/v4/objects/jlvillal/mypy_small_files_1
* Add type-hints to some of the files in gitlab/v4/objects/
* Fix issues detected when adding type-hints
* Changed mypy exclusion to explicitly list the 13 files that have
not yet had type-hints added.
Diffstat (limited to 'gitlab/v4/objects/runners.py')
-rw-r--r-- | gitlab/v4/objects/runners.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gitlab/v4/objects/runners.py b/gitlab/v4/objects/runners.py index ec8153f..fac9100 100644 --- a/gitlab/v4/objects/runners.py +++ b/gitlab/v4/objects/runners.py @@ -1,3 +1,5 @@ +from typing import Any, cast, List, Optional, Union + from gitlab import cli from gitlab import exceptions as exc from gitlab import types @@ -70,7 +72,7 @@ class RunnerManager(CRUDMixin, RESTManager): @cli.register_custom_action("RunnerManager", tuple(), ("scope",)) @exc.on_http_error(exc.GitlabListError) - def all(self, scope=None, **kwargs): + def all(self, scope: Optional[str] = None, **kwargs: Any) -> List[Runner]: """List all the runners. Args: @@ -99,7 +101,7 @@ class RunnerManager(CRUDMixin, RESTManager): @cli.register_custom_action("RunnerManager", ("token",)) @exc.on_http_error(exc.GitlabVerifyError) - def verify(self, token, **kwargs): + def verify(self, token: str, **kwargs: Any) -> None: """Validates authentication credentials for a registered Runner. Args: @@ -114,6 +116,9 @@ class RunnerManager(CRUDMixin, RESTManager): post_data = {"token": token} self.gitlab.http_post(path, post_data=post_data, **kwargs) + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Runner: + return cast(Runner, super().get(id=id, lazy=lazy, **kwargs)) + class GroupRunner(RESTObject): pass |