summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-06-03 16:31:38 -0700
committerJohn L. Villalovos <john@sodarock.com>2022-06-04 09:18:22 -0700
commitd0b0811211f69f08436dcf7617c46617fe5c0b8b (patch)
treebb0e589646740ccf46450f7e0c552ed5b3b8b0b8 /gitlab
parentd6870a981259ee44c64210a756b63dc19a6f3957 (diff)
downloadgitlab-d0b0811211f69f08436dcf7617c46617fe5c0b8b.tar.gz
chore: enable pylint check: "no-else-return"
Enable the pylint check "no-else-return" and fix the errors detected.
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/client.py3
-rw-r--r--gitlab/exceptions.py3
-rw-r--r--gitlab/mixins.py3
-rw-r--r--gitlab/v4/objects/ldap.py3
4 files changed, 4 insertions, 8 deletions
diff --git a/gitlab/client.py b/gitlab/client.py
index ffb92e6..aa612c9 100644
--- a/gitlab/client.py
+++ b/gitlab/client.py
@@ -556,8 +556,7 @@ class Gitlab:
"""
if path.startswith("http://") or path.startswith("https://"):
return path
- else:
- return f"{self._url}{path}"
+ return f"{self._url}{path}"
def _check_redirects(self, result: requests.Response) -> None:
# Check the requests history to detect 301/302 redirections.
diff --git a/gitlab/exceptions.py b/gitlab/exceptions.py
index 54f9b8c..3da399c 100644
--- a/gitlab/exceptions.py
+++ b/gitlab/exceptions.py
@@ -47,8 +47,7 @@ class GitlabError(Exception):
def __str__(self) -> str:
if self.response_code is not None:
return f"{self.response_code}: {self.error_message}"
- else:
- return f"{self.error_message}"
+ return f"{self.error_message}"
class GitlabAuthenticationError(GitlabError):
diff --git a/gitlab/mixins.py b/gitlab/mixins.py
index 3904d43..4dee710 100644
--- a/gitlab/mixins.py
+++ b/gitlab/mixins.py
@@ -231,8 +231,7 @@ class ListMixin(_RestManagerBase):
obj = self.gitlab.http_list(path, **data)
if isinstance(obj, list):
return [self._obj_cls(self, item, created_from_list=True) for item in obj]
- else:
- return base.RESTObjectList(self, self._obj_cls, obj)
+ return base.RESTObjectList(self, self._obj_cls, obj)
class RetrieveMixin(ListMixin, GetMixin):
diff --git a/gitlab/v4/objects/ldap.py b/gitlab/v4/objects/ldap.py
index 4a01061..053cd14 100644
--- a/gitlab/v4/objects/ldap.py
+++ b/gitlab/v4/objects/ldap.py
@@ -49,5 +49,4 @@ class LDAPGroupManager(RESTManager):
obj = self.gitlab.http_list(path, **data)
if isinstance(obj, list):
return [self._obj_cls(self, item) for item in obj]
- else:
- return RESTObjectList(self, self._obj_cls, obj)
+ return RESTObjectList(self, self._obj_cls, obj)