diff options
| author | Nejc Habjan <nejc.habjan@siemens.com> | 2022-07-05 11:48:55 +0200 |
|---|---|---|
| committer | John Villalovos <john@sodarock.com> | 2022-07-05 09:19:34 -0700 |
| commit | 6491f1bbb68ffe04c719eb9d326b7ca3e78eba84 (patch) | |
| tree | 14bc790ff3fe045378ee9bee2886a4b1cad6594e /gitlab | |
| parent | 1fbfb224388c107ada9c741e88193179eab3f23c (diff) | |
| download | gitlab-6491f1bbb68ffe04c719eb9d326b7ca3e78eba84.tar.gz | |
refactor(objects): move ci lint to separate file
Diffstat (limited to 'gitlab')
| -rw-r--r-- | gitlab/v4/objects/__init__.py | 1 | ||||
| -rw-r--r-- | gitlab/v4/objects/ci_lint.py | 22 | ||||
| -rw-r--r-- | gitlab/v4/objects/projects.py | 17 |
3 files changed, 24 insertions, 16 deletions
diff --git a/gitlab/v4/objects/__init__.py b/gitlab/v4/objects/__init__.py index 40f9bf3..a390a4d 100644 --- a/gitlab/v4/objects/__init__.py +++ b/gitlab/v4/objects/__init__.py @@ -25,6 +25,7 @@ from .badges import * from .boards import * from .branches import * from .broadcast_messages import * +from .ci_lint import * from .clusters import * from .commits import * from .container_registry import * diff --git a/gitlab/v4/objects/ci_lint.py b/gitlab/v4/objects/ci_lint.py new file mode 100644 index 0000000..3d5d488 --- /dev/null +++ b/gitlab/v4/objects/ci_lint.py @@ -0,0 +1,22 @@ +""" +GitLab API: +https://docs.gitlab.com/ee/api/lint.html +""" + +from typing import Any, cast + +from gitlab.base import RESTManager, RESTObject +from gitlab.mixins import CreateMixin, GetWithoutIdMixin + + +class ProjectCiLint(RESTObject): + pass + + +class ProjectCiLintManager(GetWithoutIdMixin, CreateMixin, RESTManager): + _path = "/projects/{project_id}/ci/lint" + _obj_cls = ProjectCiLint + _from_parent_attrs = {"project_id": "id"} + + def get(self, **kwargs: Any) -> ProjectCiLint: + return cast(ProjectCiLint, super().get(**kwargs)) diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index 367ab68..9d7262f 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -1,7 +1,6 @@ """ GitLab API: https://docs.gitlab.com/ee/api/projects.html -https://docs.gitlab.com/ee/api/lint.html """ from typing import ( Any, @@ -39,6 +38,7 @@ from .audit_events import ProjectAuditEventManager # noqa: F401 from .badges import ProjectBadgeManager # noqa: F401 from .boards import ProjectBoardManager # noqa: F401 from .branches import ProjectBranchManager, ProjectProtectedBranchManager # noqa: F401 +from .ci_lint import ProjectCiLint, ProjectCiLintManager # noqa: F401 from .clusters import ProjectClusterManager # noqa: F401 from .commits import ProjectCommitManager # noqa: F401 from .container_registry import ProjectRegistryRepositoryManager # noqa: F401 @@ -1063,18 +1063,3 @@ class ProjectStorageManager(GetWithoutIdMixin, RESTManager): def get(self, **kwargs: Any) -> ProjectStorage: return cast(ProjectStorage, super().get(**kwargs)) - - -class ProjectCiLint(RESTObject): - pass - - -class ProjectCiLintManager(GetWithoutIdMixin, CreateMixin, RESTManager): - """GitLab API: https://docs.gitlab.com/ee/api/lint.html""" - - _path = "/projects/{project_id}/ci/lint" - _obj_cls = ProjectCiLint - _from_parent_attrs = {"project_id": "id"} - - def get(self, **kwargs: Any) -> ProjectCiLint: - return cast(ProjectCiLint, super().get(**kwargs)) |
