Skip to content

Commit

Permalink
fix: fix pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
anancarv committed Jan 4, 2022
1 parent 5a7fbc1 commit fbe217a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions pyartifactory/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def get(self, name: str) -> UserResponse:
logger.debug("User %s found", name)
return UserResponse(**response.json())
except requests.exceptions.HTTPError as error:
if error.response.status_code == 404 or error.response.status_code == 400:
if error.response.status_code in (404, 400):
logger.error("User %s does not exist", name)
raise UserNotFoundException(f"{name} does not exist")
raise ArtifactoryException from error
Expand Down Expand Up @@ -224,7 +224,7 @@ def get(self, permission_name: str) -> AnyPermission:
else PermissionV2(**response.json())
)
except requests.exceptions.HTTPError as error:
if error.response.status_code == 404 or error.response.status_code == 400:
if error.response.status_code in (404, 400):
logger.error("Permission %s does not exist", permission_name)
raise PermissionNotFoundException(
f"Permission {permission_name} does not exist"
Expand Down Expand Up @@ -426,7 +426,7 @@ def get(self, name: str) -> Group:
logger.debug("Group %s found", name)
return Group(**response.json())
except requests.exceptions.HTTPError as error:
if error.response.status_code == 404 or error.response.status_code == 400:
if error.response.status_code in (404, 400):
logger.error("Group %s does not exist", name)
raise GroupNotFoundException(f"Group {name} does not exist")
raise ArtifactoryException from error
Expand Down Expand Up @@ -487,7 +487,7 @@ def get_repo(self, repo_name: str) -> AnyRepositoryResponse:
)
return repo
except requests.exceptions.HTTPError as error:
if error.response.status_code == 404 or error.response.status_code == 400:
if error.response.status_code in (404, 400):
logger.error("Repository %s does not exist", repo_name)
raise RepositoryNotFoundException(
f" Repository {repo_name} does not exist"
Expand Down Expand Up @@ -598,7 +598,7 @@ def get_local_repo(self, repo_name: str) -> LocalRepositoryResponse:
logger.debug("Repository %s found", repo_name)
return LocalRepositoryResponse(**response.json())
except requests.exceptions.HTTPError as error:
if error.response.status_code == 404 or error.response.status_code == 400:
if error.response.status_code in (404, 400):
raise RepositoryNotFoundException(
f" Repository {repo_name} does not exist"
)
Expand Down Expand Up @@ -658,7 +658,7 @@ def get_virtual_repo(self, repo_name: str) -> VirtualRepositoryResponse:
logger.debug("Repository %s found", repo_name)
return VirtualRepositoryResponse(**response.json())
except requests.exceptions.HTTPError as error:
if error.response.status_code == 404 or error.response.status_code == 400:
if error.response.status_code in (404, 400):
raise RepositoryNotFoundException(
f" Repository {repo_name} does not exist"
)
Expand Down Expand Up @@ -718,7 +718,7 @@ def get_remote_repo(self, repo_name: str) -> RemoteRepositoryResponse:
logger.debug("Repository %s found", repo_name)
return RemoteRepositoryResponse(**response.json())
except requests.exceptions.HTTPError as error:
if error.response.status_code == 404 or error.response.status_code == 400:
if error.response.status_code in (404, 400):
raise RepositoryNotFoundException(
f" Repository {repo_name} does not exist"
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tests

[tool.pylint.messages_control]
disable = """
bad-continuation,line-too-long,too-few-public-methods,import-error,too-many-instance-attributes, too-many-arguments, raise-missing-from
bad-continuation,line-too-long,too-few-public-methods,import-error,too-many-instance-attributes, too-many-arguments, raise-missing-from, invalid-name
"""

[tool.pylint.basic]
Expand Down

0 comments on commit fbe217a

Please sign in to comment.