Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23feae9

Browse files
test(pylint): enable pylint "unused-argument" check
Enable the pylint "unused-argument" check and resolve issues it found. * Quite a few functions were accepting `**kwargs` but not then passing them on through to the next level. Now pass `**kwargs` to next level. * Other functions had no reason to accept `**kwargs`, so remove it * And a few other fixes.
1 parentb644721 commit23feae9

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
classJSONPrinter:
383383
@staticmethod
384-
defdisplay(d:Union[str,Dict[str,Any]],**kwargs:Any)->None:
384+
defdisplay(d:Union[str,Dict[str,Any]],**_kwargs:Any)->None:
385385
importjson# noqa
386386

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

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

400400
classYAMLPrinter:
401401
@staticmethod
402-
defdisplay(d:Union[str,Dict[str,Any]],**kwargs:Any)->None:
402+
defdisplay(d:Union[str,Dict[str,Any]],**_kwargs:Any)->None:
403403
try:
404404
importyaml# noqa
405405

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

435435

436436
classLegacyPrinter:
437-
defdisplay(self,d:Union[str,Dict[str,Any]],**kwargs:Any)->None:
437+
defdisplay(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
ifproviderisnotNone:
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
ifTYPE_CHECKING:
3333
assertisinstance(result,dict)
3434
returnresult
@@ -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
ifTYPE_CHECKING:
5151
assertisinstance(result,dict)
5252
returnresult
@@ -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
returnar
159159
# if there was no rule matching the rule name, create a new one
160-
returnapproval_rules.create(data=data)
160+
returnapproval_rules.create(data=data,**kwargs)
161161

162162

163163
classProjectMergeRequestApprovalRule(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-
returnself.manager.gitlab.http_post(path)
74+
returnself.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-
returnself.manager.gitlab.http_post(path)
89+
returnself.manager.gitlab.http_post(path,**kwargs)
9090

9191

9292
classProjectPipelineManager(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
ifTYPE_CHECKING:
470470
assertisinstance(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
ifTYPE_CHECKING:
510510
assertisinstance(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
returncast(ProjectService,super().get(id=id,lazy=lazy,**kwargs))
268268

269269
@cli.register_custom_action("ProjectServiceManager")
270-
defavailable(self,**kwargs:Any)->List[str]:
270+
defavailable(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)

[8]ページ先頭

©2009-2025 Movatter.jp