Skip to content

Commit 3c3f865

Browse files
authored
Merge pull request #2100 from python-gitlab/jlvillal/pylint_2022-06-26
test(pylint): enable pylint "unused-argument" check
2 parents acc5c39 + 23feae9 commit 3c3f865

File tree

9 files changed

+19
-20
lines changed

9 files changed

+19
-20
lines changed

gitlab/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ def http_post(
967967
query_data=query_data,
968968
post_data=post_data,
969969
files=files,
970+
raw=raw,
970971
**kwargs,
971972
)
972973
try:

gitlab/v4/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def get_dict(
381381

382382
class JSONPrinter:
383383
@staticmethod
384-
def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
384+
def display(d: Union[str, Dict[str, Any]], **_kwargs: Any) -> None:
385385
import json # noqa
386386

387387
print(json.dumps(d))
@@ -390,7 +390,7 @@ def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
390390
def display_list(
391391
data: List[Union[str, gitlab.base.RESTObject]],
392392
fields: List[str],
393-
**kwargs: Any,
393+
**_kwargs: Any,
394394
) -> None:
395395
import json # noqa
396396

@@ -399,7 +399,7 @@ def display_list(
399399

400400
class YAMLPrinter:
401401
@staticmethod
402-
def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
402+
def display(d: Union[str, Dict[str, Any]], **_kwargs: Any) -> None:
403403
try:
404404
import yaml # noqa
405405

@@ -415,7 +415,7 @@ def display(d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
415415
def display_list(
416416
data: List[Union[str, gitlab.base.RESTObject]],
417417
fields: List[str],
418-
**kwargs: Any,
418+
**_kwargs: Any,
419419
) -> None:
420420
try:
421421
import yaml # noqa
@@ -434,7 +434,7 @@ def display_list(
434434

435435

436436
class LegacyPrinter:
437-
def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
437+
def display(self, _d: Union[str, Dict[str, Any]], **kwargs: Any) -> None:
438438
verbose = kwargs.get("verbose", False)
439439
padding = kwargs.get("padding", 0)
440440
obj: Optional[Union[Dict[str, Any], gitlab.base.RESTObject]] = kwargs.get("obj")

gitlab/v4/objects/groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def delete_ldap_group_link(
183183
if provider is not None:
184184
path += f"/{provider}"
185185
path += f"/{cn}"
186-
self.manager.gitlab.http_delete(path)
186+
self.manager.gitlab.http_delete(path, **kwargs)
187187

188188
@cli.register_custom_action("Group")
189189
@exc.on_http_error(exc.GitlabCreateError)

gitlab/v4/objects/jobs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def cancel(self, **kwargs: Any) -> Dict[str, Any]:
2828
GitlabJobCancelError: If the job could not be canceled
2929
"""
3030
path = f"{self.manager.path}/{self.encoded_id}/cancel"
31-
result = self.manager.gitlab.http_post(path)
31+
result = self.manager.gitlab.http_post(path, **kwargs)
3232
if TYPE_CHECKING:
3333
assert isinstance(result, dict)
3434
return result
@@ -46,7 +46,7 @@ def retry(self, **kwargs: Any) -> Dict[str, Any]:
4646
GitlabJobRetryError: If the job could not be retried
4747
"""
4848
path = f"{self.manager.path}/{self.encoded_id}/retry"
49-
result = self.manager.gitlab.http_post(path)
49+
result = self.manager.gitlab.http_post(path, **kwargs)
5050
if TYPE_CHECKING:
5151
assert isinstance(result, dict)
5252
return result
@@ -64,7 +64,7 @@ def play(self, **kwargs: Any) -> None:
6464
GitlabJobPlayError: If the job could not be triggered
6565
"""
6666
path = f"{self.manager.path}/{self.encoded_id}/play"
67-
self.manager.gitlab.http_post(path)
67+
self.manager.gitlab.http_post(path, **kwargs)
6868

6969
@cli.register_custom_action("ProjectJob")
7070
@exc.on_http_error(exc.GitlabJobEraseError)
@@ -79,7 +79,7 @@ def erase(self, **kwargs: Any) -> None:
7979
GitlabJobEraseError: If the job could not be erased
8080
"""
8181
path = f"{self.manager.path}/{self.encoded_id}/erase"
82-
self.manager.gitlab.http_post(path)
82+
self.manager.gitlab.http_post(path, **kwargs)
8383

8484
@cli.register_custom_action("ProjectJob")
8585
@exc.on_http_error(exc.GitlabCreateError)
@@ -94,7 +94,7 @@ def keep_artifacts(self, **kwargs: Any) -> None:
9494
GitlabCreateError: If the request could not be performed
9595
"""
9696
path = f"{self.manager.path}/{self.encoded_id}/artifacts/keep"
97-
self.manager.gitlab.http_post(path)
97+
self.manager.gitlab.http_post(path, **kwargs)
9898

9999
@cli.register_custom_action("ProjectJob")
100100
@exc.on_http_error(exc.GitlabCreateError)
@@ -109,7 +109,7 @@ def delete_artifacts(self, **kwargs: Any) -> None:
109109
GitlabDeleteError: If the request could not be performed
110110
"""
111111
path = f"{self.manager.path}/{self.encoded_id}/artifacts"
112-
self.manager.gitlab.http_delete(path)
112+
self.manager.gitlab.http_delete(path, **kwargs)
113113

114114
@cli.register_custom_action("ProjectJob")
115115
@exc.on_http_error(exc.GitlabGetError)

gitlab/v4/objects/merge_request_approvals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def set_approvers(
157157
ar.save()
158158
return ar
159159
# if there was no rule matching the rule name, create a new one
160-
return approval_rules.create(data=data)
160+
return approval_rules.create(data=data, **kwargs)
161161

162162

163163
class ProjectMergeRequestApprovalRule(SaveMixin, ObjectDeleteMixin, RESTObject):

gitlab/v4/objects/pipelines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def cancel(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
7171
GitlabPipelineCancelError: If the request failed
7272
"""
7373
path = f"{self.manager.path}/{self.encoded_id}/cancel"
74-
return self.manager.gitlab.http_post(path)
74+
return self.manager.gitlab.http_post(path, **kwargs)
7575

7676
@cli.register_custom_action("ProjectPipeline")
7777
@exc.on_http_error(exc.GitlabPipelineRetryError)
@@ -86,7 +86,7 @@ def retry(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
8686
GitlabPipelineRetryError: If the request failed
8787
"""
8888
path = f"{self.manager.path}/{self.encoded_id}/retry"
89-
return self.manager.gitlab.http_post(path)
89+
return self.manager.gitlab.http_post(path, **kwargs)
9090

9191

9292
class ProjectPipelineManager(RetrieveMixin, CreateMixin, DeleteMixin, RESTManager):

gitlab/v4/objects/projects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def upload(
464464

465465
url = f"/projects/{self.encoded_id}/uploads"
466466
file_info = {"file": (filename, filedata)}
467-
data = self.manager.gitlab.http_post(url, files=file_info)
467+
data = self.manager.gitlab.http_post(url, files=file_info, **kwargs)
468468

469469
if TYPE_CHECKING:
470470
assert isinstance(data, dict)
@@ -504,7 +504,7 @@ def snapshot(
504504
"""
505505
path = f"/projects/{self.encoded_id}/snapshot"
506506
result = self.manager.gitlab.http_get(
507-
path, streamed=streamed, raw=True, **kwargs
507+
path, streamed=streamed, raw=True, wiki=wiki, **kwargs
508508
)
509509
if TYPE_CHECKING:
510510
assert isinstance(result, requests.Response)

gitlab/v4/objects/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def get(
267267
return cast(ProjectService, super().get(id=id, lazy=lazy, **kwargs))
268268

269269
@cli.register_custom_action("ProjectServiceManager")
270-
def available(self, **kwargs: Any) -> List[str]:
270+
def available(self) -> List[str]:
271271
"""List the services known by python-gitlab.
272272
273273
Returns:

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ disable = [
7070
"too-many-locals",
7171
"too-many-statements",
7272
"unsubscriptable-object",
73-
"unused-argument",
74-
7573
]
7674

7775
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)