Skip to content

Commit 8baa18e

Browse files
committed
all linting passed!
1 parent c386fcd commit 8baa18e

File tree

7 files changed

+92
-184
lines changed

7 files changed

+92
-184
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ repos:
44
hooks:
55
- id: isort
66
language_version: python3.7
7-
args: [--line-length=127]
7+
args: [ --line-length=127 ]
88
- repo: https://github.com/python/black
99
rev: 20.8b1
1010
hooks:
1111
- id: black
1212
language_version: python3.7
13-
args: [--line-length=127]
13+
args: [ --line-length=127 ]
1414
- repo: https://gitlab.com/pycqa/flake8
1515
rev: 3.8.3
1616
hooks:
1717
- id: flake8
1818
additional_dependencies: [
19-
flake8-docstrings,
20-
flake8-builtins,
21-
flake8-comprehensions,
22-
flake8-print,
23-
flake8-eradicate,
19+
flake8-docstrings,
20+
flake8-builtins,
21+
flake8-comprehensions,
22+
flake8-print,
23+
flake8-eradicate,
2424
]
2525
language_version: python3.7
2626
args: [
27-
--max-line-length=127,
28-
'--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D210,D401,W503,E203'
27+
--max-line-length=127,
28+
'--ignore=D100,D101,D102,D103,D104,D105,D106,D107,D200,D205,D210,D400,D401,W503,E203,F403,F405,T001'
2929
]
3030
# See https://stackoverflow.com/questions/61238318/pylint-and-pre-commit-hook-unable-to-import/61238571#61238571
3131
- repo: local
@@ -34,11 +34,11 @@ repos:
3434
name: pylint
3535
entry: pylint
3636
language: system
37-
types: [python]
37+
types: [ python ]
3838
args: [
39-
# --max-line-length=127,
40-
# --max-public-methods=32,
41-
# --max-args=8,
42-
'--disable=too-few-public-methods,logging-fstring-interpolation,too-many-instance-attributes,no-else-return,too-many-locals,no-self-use,duplicate-code,broad-except,logging-not-lazy,unspecified-encoding',
43-
'--good-names=ip,rc,eval'
39+
--max-line-length=127,
40+
--max-public-methods=32,
41+
--max-args=9,
42+
'--disable=too-few-public-methods,logging-fstring-interpolation,too-many-instance-attributes,no-else-return,too-many-locals,no-self-use,duplicate-code,broad-except,logging-not-lazy,unspecified-encoding, unused-wildcard-import,missing-function-docstring,missing-module-docstring,import-error,wildcard-import,invalid-name,redefined-outer-name,no-name-in-module',
43+
'--good-names=ip,rc,eval'
4444
]

cloudshell/sandbox_rest/exceptions.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33

44
class SandboxRestException(Exception):
5-
"""Base Exception Class inside Rest client class"""
5+
""" Base Exception Class inside Rest client class """
66

7-
def __init__(self, msg: str, response: Response = None):
8-
self.msg = msg
7+
def __init__(self, message: str, response: Response = None):
8+
super().__init__(message)
9+
self.message = message
910
self.response = response
1011

1112
def __str__(self):
12-
return self._format_err_msg(self.msg, self.response)
13+
return self._format_err_msg(self.message, self.response)
1314

14-
def _format_err_msg(
15-
self, custom_err_msg="Failed Api Call", response: Response = None
16-
) -> str:
15+
def _format_err_msg(self, custom_err_msg="Failed Api Call", response: Response = None) -> str:
1716
err_msg = f"Sandbox API Error: {custom_err_msg}"
1817

1918
if response:
2019
err_msg += f"\n{self._format_response_msg(response)}"
20+
return err_msg
2121

2222
@staticmethod
2323
def _format_response_msg(response: Response):
@@ -30,5 +30,3 @@ def _format_response_msg(response: Response):
3030

3131
class SandboxRestAuthException(SandboxRestException):
3232
"""Failed auth action"""
33-
34-
pass

0 commit comments

Comments
 (0)