| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ae2a015 commit 019a40f
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -317,8 +317,8 @@ def total(self) -> Optional[int]: | |||
| 317 | 317 | ||
| 318 | 318 | ||
| 319 | 319 | class RequiredOptional(NamedTuple): | |
| 320 | - required: Tuple[str, ...] = tuple() | ||
| 321 | - optional: Tuple[str, ...] = tuple() | ||
| 320 | + required: Tuple[str, ...] = () | ||
| 321 | + optional: Tuple[str, ...] = () | ||
| 322 | 322 | ||
| 323 | 323 | ||
| 324 | 324 | class RESTManager: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,8 +52,8 @@ | |||
| 52 | 52 | ||
| 53 | 53 | def register_custom_action( | |
| 54 | 54 | cls_names: Union[str, Tuple[str, ...]], | |
| 55 | - mandatory: Tuple[str, ...] = tuple(), | ||
| 56 | - optional: Tuple[str, ...] = tuple(), | ||
| 55 | + mandatory: Tuple[str, ...] = (), | ||
| 56 | + optional: Tuple[str, ...] = (), | ||
| 57 | 57 | custom_action: Optional[str] = None, | |
| 58 | 58 | ) -> Callable[[__F], __F]: | |
| 59 | 59 | def wrap(f: __F) -> __F: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -616,7 +616,7 @@ class AccessRequestMixin(_RestObjectBase): | |||
| 616 | 616 | manager: base.RESTManager | |
| 617 | 617 | ||
| 618 | 618 | @cli.register_custom_action( | |
| 619 | - ("ProjectAccessRequest", "GroupAccessRequest"), tuple(), ("access_level",) | ||
| 619 | + ("ProjectAccessRequest", "GroupAccessRequest"), (), ("access_level",) | ||
| 620 | 620 | ) | |
| 621 | 621 | @exc.on_http_error(exc.GitlabUpdateError) | |
| 622 | 622 | def approve( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,7 +95,7 @@ def transfer_project(self, project_id: int, **kwargs: Any) -> None: | |||
| 95 | 95 | path = f"/groups/{self.encoded_id}/projects/{project_id}" | |
| 96 | 96 | self.manager.gitlab.http_post(path, **kwargs) | |
| 97 | 97 | ||
| 98 | - @cli.register_custom_action("Group", tuple(), ("group_id",)) | ||
| 98 | + @cli.register_custom_action("Group", (), ("group_id",)) | ||
| 99 | 99 | @exc.on_http_error(exc.GitlabGroupTransferError) | |
| 100 | 100 | def transfer(self, group_id: Optional[int] = None, **kwargs: Any) -> None: | |
| 101 | 101 | """Transfer the group to a new parent group or make it a top-level group. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -263,7 +263,7 @@ def changes(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]: | |||
| 263 | 263 | path = f"{self.manager.path}/{self.encoded_id}/changes" | |
| 264 | 264 | return self.manager.gitlab.http_get(path, **kwargs) | |
| 265 | 265 | ||
| 266 | - @cli.register_custom_action("ProjectMergeRequest", tuple(), ("sha",)) | ||
| 266 | + @cli.register_custom_action("ProjectMergeRequest", (), ("sha",)) | ||
| 267 | 267 | @exc.on_http_error(exc.GitlabMRApprovalError) | |
| 268 | 268 | def approve(self, sha: Optional[str] = None, **kwargs: Any) -> Dict[str, Any]: | |
| 269 | 269 | """Approve the merge request. | |
@@ -347,7 +347,7 @@ def merge_ref(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]: | |||
| 347 | 347 | ||
| 348 | 348 | @cli.register_custom_action( | |
| 349 | 349 | "ProjectMergeRequest", | |
| 350 | - tuple(), | ||
| 350 | + (), | ||
| 351 | 351 | ( | |
| 352 | 352 | "merge_commit_message", | |
| 353 | 353 | "should_remove_source_branch", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,7 +46,7 @@ def update_submodule( | |||
| 46 | 46 | data["commit_message"] = kwargs["commit_message"] | |
| 47 | 47 | return self.manager.gitlab.http_put(path, post_data=data) | |
| 48 | 48 | ||
| 49 | - @cli.register_custom_action("Project", tuple(), ("path", "ref", "recursive")) | ||
| 49 | + @cli.register_custom_action("Project", (), ("path", "ref", "recursive")) | ||
| 50 | 50 | @exc.on_http_error(exc.GitlabGetError) | |
| 51 | 51 | def repository_tree( | |
| 52 | 52 | self, path: str = "", ref: str = "", recursive: bool = False, **kwargs: Any | |
@@ -186,7 +186,7 @@ def repository_contributors( | |||
| 186 | 186 | path = f"/projects/{self.encoded_id}/repository/contributors" | |
| 187 | 187 | return self.manager.gitlab.http_list(path, **kwargs) | |
| 188 | 188 | ||
| 189 | - @cli.register_custom_action("Project", tuple(), ("sha", "format")) | ||
| 189 | + @cli.register_custom_action("Project", (), ("sha", "format")) | ||
| 190 | 190 | @exc.on_http_error(exc.GitlabListError) | |
| 191 | 191 | def repository_archive( | |
| 192 | 192 | self, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,7 +70,7 @@ class RunnerManager(CRUDMixin, RESTManager): | |||
| 70 | 70 | _list_filters = ("scope", "tag_list") | |
| 71 | 71 | _types = {"tag_list": types.CommaSeparatedListAttribute} | |
| 72 | 72 | ||
| 73 | - @cli.register_custom_action("RunnerManager", tuple(), ("scope",)) | ||
| 73 | + @cli.register_custom_action("RunnerManager", (), ("scope",)) | ||
| 74 | 74 | @exc.on_http_error(exc.GitlabListError) | |
| 75 | 75 | def all(self, scope: Optional[str] = None, **kwargs: Any) -> List[Runner]: | |
| 76 | 76 | """List all the runners. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,7 +96,7 @@ class ProjectServiceManager(GetMixin, UpdateMixin, DeleteMixin, ListMixin, RESTM | |||
| 96 | 96 | "pipeline_events", | |
| 97 | 97 | ), | |
| 98 | 98 | ), | |
| 99 | - "external-wiki": (("external_wiki_url",), tuple()), | ||
| 99 | + "external-wiki": (("external_wiki_url",), ()), | ||
| 100 | 100 | "flowdock": (("token",), ("push_events",)), | |
| 101 | 101 | "github": (("token", "repository_url"), ("static_context",)), | |
| 102 | 102 | "hangouts-chat": ( | |
@@ -159,7 +159,7 @@ class ProjectServiceManager(GetMixin, UpdateMixin, DeleteMixin, ListMixin, RESTM | |||
| 159 | 159 | "comment_on_event_enabled", | |
| 160 | 160 | ), | |
| 161 | 161 | ), | |
| 162 | - "slack-slash-commands": (("token",), tuple()), | ||
| 162 | + "slack-slash-commands": (("token",), ()), | ||
| 163 | 163 | "mattermost-slash-commands": (("token",), ("username",)), | |
| 164 | 164 | "packagist": ( | |
| 165 | 165 | ("username", "token"), | |
@@ -194,7 +194,7 @@ class ProjectServiceManager(GetMixin, UpdateMixin, DeleteMixin, ListMixin, RESTM | |||
| 194 | 194 | ), | |
| 195 | 195 | ), | |
| 196 | 196 | "pivotaltracker": (("token",), ("restrict_to_branch", "push_events")), | |
| 197 | - "prometheus": (("api_url",), tuple()), | ||
| 197 | + "prometheus": (("api_url",), ()), | ||
| 198 | 198 | "pushover": ( | |
| 199 | 199 | ("api_key", "user_key", "priority"), | |
| 200 | 200 | ("device", "sound", "push_events"), | |
@@ -257,7 +257,7 @@ class ProjectServiceManager(GetMixin, UpdateMixin, DeleteMixin, ListMixin, RESTM | |||
| 257 | 257 | ("push_events",), | |
| 258 | 258 | ), | |
| 259 | 259 | "jenkins": (("jenkins_url", "project_name"), ("username", "password")), | |
| 260 | - "mock-ci": (("mock_service_url",), tuple()), | ||
| 260 | + "mock-ci": (("mock_service_url",), ()), | ||
| 261 | 261 | "youtrack": (("issues_url", "project_url"), ("description", "push_events")), | |
| 262 | 262 | } | |
| 263 | 263 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -164,7 +164,7 @@ def test_rate_limits(gl): | |||
| 164 | 164 | settings.throttle_authenticated_api_period_in_seconds = 3 | |
| 165 | 165 | settings.save() | |
| 166 | 166 | ||
| 167 | - projects = list() | ||
| 167 | + projects = [] | ||
| 168 | 168 | for i in range(0, 20): | |
| 169 | 169 | projects.append(gl.projects.create({"name": f"{str(i)}ok"})) | |
| 170 | 170 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -328,7 +328,7 @@ def test_project_groups_list(gl, group): | |||
| 328 | 328 | ||
| 329 | 329 | groups = project.groups.list() | |
| 330 | 330 | group_ids = set([x.id for x in groups]) | |
| 331 | - assert set((group.id, group2.id)) == group_ids | ||
| 331 | + assert {group.id, group2.id} == group_ids | ||
| 332 | 332 | ||
| 333 | 333 | ||
| 334 | 334 | def test_project_transfer(gl, project, group): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments