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

Appearance settings

Commit d0b0811

Browse filesBrowse files
chore: enable pylint check: "no-else-return"
Enable the pylint check "no-else-return" and fix the errors detected.
1 parent d6870a9 commit d0b0811
Copy full SHA for d0b0811

File tree

Expand file treeCollapse file tree

5 files changed

+4
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+4
-9
lines changed
Open diff view settings
Collapse file

‎gitlab/client.py‎

Copy file name to clipboardExpand all lines: gitlab/client.py
+1-2Lines 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
if path.startswith("http://") or path.startswith("https://"):
558558
return path
559-
else:
560-
return f"{self._url}{path}"
559+
return f"{self._url}{path}"
561560

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

‎gitlab/exceptions.py‎

Copy file name to clipboardExpand all lines: gitlab/exceptions.py
+1-2Lines 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
if self.response_code is not None:
4949
return f"{self.response_code}: {self.error_message}"
50-
else:
51-
return f"{self.error_message}"
50+
return f"{self.error_message}"
5251

5352

5453
class GitlabAuthenticationError(GitlabError):
Collapse file

‎gitlab/mixins.py‎

Copy file name to clipboardExpand all lines: gitlab/mixins.py
+1-2Lines 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
if isinstance(obj, list):
233233
return [self._obj_cls(self, item, created_from_list=True) for item in obj]
234-
else:
235-
return base.RESTObjectList(self, self._obj_cls, obj)
234+
return base.RESTObjectList(self, self._obj_cls, obj)
236235

237236

238237
class RetrieveMixin(ListMixin, GetMixin):
Collapse file

‎gitlab/v4/objects/ldap.py‎

Copy file name to clipboardExpand all lines: gitlab/v4/objects/ldap.py
+1-2Lines 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
if isinstance(obj, list):
5151
return [self._obj_cls(self, item) for item in obj]
52-
else:
53-
return RESTObjectList(self, self._obj_cls, obj)
52+
return RESTObjectList(self, self._obj_cls, obj)
Collapse file

‎pyproject.toml‎

Copy file name to clipboardExpand all lines: pyproject.toml
-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.