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

Commitd0b0811

Browse files
chore: enable pylint check: "no-else-return"
Enable the pylint check "no-else-return" and fix the errors detected.
1 parentd6870a9 commitd0b0811

File tree

5 files changed

+4
-9
lines changed

5 files changed

+4
-9
lines changed

‎gitlab/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,7 @@ def _build_url(self, path: str) -> str:
556556
"""
557557
ifpath.startswith("http://")orpath.startswith("https://"):
558558
returnpath
559-
else:
560-
returnf"{self._url}{path}"
559+
returnf"{self._url}{path}"
561560

562561
def_check_redirects(self,result:requests.Response)->None:
563562
# Check the requests history to detect 301/302 redirections.

‎gitlab/exceptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def __init__(
4747
def__str__(self)->str:
4848
ifself.response_codeisnotNone:
4949
returnf"{self.response_code}:{self.error_message}"
50-
else:
51-
returnf"{self.error_message}"
50+
returnf"{self.error_message}"
5251

5352

5453
classGitlabAuthenticationError(GitlabError):

‎gitlab/mixins.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ def list(self, **kwargs: Any) -> Union[base.RESTObjectList, List[base.RESTObject
231231
obj=self.gitlab.http_list(path,**data)
232232
ifisinstance(obj,list):
233233
return [self._obj_cls(self,item,created_from_list=True)foriteminobj]
234-
else:
235-
returnbase.RESTObjectList(self,self._obj_cls,obj)
234+
returnbase.RESTObjectList(self,self._obj_cls,obj)
236235

237236

238237
classRetrieveMixin(ListMixin,GetMixin):

‎gitlab/v4/objects/ldap.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,4 @@ def list(self, **kwargs: Any) -> Union[List[LDAPGroup], RESTObjectList]:
4949
obj=self.gitlab.http_list(path,**data)
5050
ifisinstance(obj,list):
5151
return [self._obj_cls(self,item)foriteminobj]
52-
else:
53-
returnRESTObjectList(self,self._obj_cls,obj)
52+
returnRESTObjectList(self,self._obj_cls,obj)

‎pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ disable = [
5757
"missing-class-docstring",
5858
"missing-function-docstring",
5959
"missing-module-docstring",
60-
"no-else-return",
6160
"no-self-use",
6261
"protected-access",
6362
"redefined-builtin",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp