Skip to content
Merged

E721 #14

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/abstract/v00/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_Text(self) -> str:

# --------------------------------------------------------------------
def Delete(self, withLineIfLast: bool):
assert type(withLineIfLast) == bool
assert type(withLineIfLast) == bool # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "Delete")


Expand Down Expand Up @@ -162,7 +162,7 @@ def get_File(self) -> PostgresConfigurationFile:

# --------------------------------------------------------------------
def Delete(self, withLine: bool):
assert type(withLine) == bool
assert type(withLine) == bool # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "Delete")


Expand All @@ -182,27 +182,27 @@ def __len__(self) -> int:
def AddComment(
self, text: str, offset: typing.Optional[int]
) -> PostgresConfigurationComment:
assert type(text) == str
assert (offset is None) or (type(offset) == int)
assert type(text) == str # noqa: E721
assert (offset is None) or (type(offset) == int) # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "AddComment")

# --------------------------------------------------------------------
def AddOption(
self, name: str, value: any, offset: typing.Optional[int]
) -> PostgresConfigurationOption:
assert type(name) == str
assert type(name) == str # noqa: E721
assert name != ""
assert value is not None
assert (offset is None) or (type(offset) == int)
assert (offset is None) or (type(offset) == int) # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "AddOption")

# --------------------------------------------------------------------
def AddInclude(
self, path: str, offset: typing.Optional[int]
) -> PostgresConfigurationInclude:
assert type(path) == str
assert type(path) == str # noqa: E721
assert path != ""
assert (offset is None) or (type(offset) == int)
assert (offset is None) or (type(offset) == int) # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "AddInclude")

# --------------------------------------------------------------------
Expand Down Expand Up @@ -271,19 +271,19 @@ def AddEmptyLine(self) -> PostgresConfigurationFileLine:

# --------------------------------------------------------------------
def AddComment(self, text: str) -> PostgresConfigurationComment:
assert type(text) == str
assert type(text) == str # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "AddComment")

# --------------------------------------------------------------------
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
assert type(name) == str
assert type(name) == str # noqa: E721
assert name != ""
assert value is not None
RaiseError.MethodIsNotImplemented(__class__, "AddOption")

# --------------------------------------------------------------------
def AddInclude(self, path: str) -> PostgresConfigurationInclude:
assert type(path) == str
assert type(path) == str # noqa: E721
assert path != ""
RaiseError.MethodIsNotImplemented(__class__, "AddInclude")

Expand All @@ -301,7 +301,7 @@ def AddInclude(self, path: str) -> PostgresConfigurationInclude:
def SetOptionValue(
self, name: str, value: any
) -> PostgresConfigurationSetOptionValueResult:
assert type(name) == str
assert type(name) == str # noqa: E721
assert name != ""
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValue")

Expand All @@ -314,14 +314,14 @@ def SetOptionValue(
# - None if option is not found in this file.
#
def GetOptionValue(self, name: str) -> any:
assert type(name) == str
assert type(name) == str # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")

# --------------------------------------------------------------------
def SetOptionValueItem(
self, name: str, value_item: any
) -> PostgresConfigurationSetOptionValueResult:
assert type(name) == str
assert type(name) == str # noqa: E721
assert name != ""
assert value_item is not None
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValueItem")
Expand Down Expand Up @@ -375,13 +375,13 @@ def __init__(self):

# interface ----------------------------------------------------------
def AddTopLevelFile(self, path: str) -> PostgresConfigurationFile:
assert type(path) == str
assert type(path) == str # noqa: E721
assert path != ""
RaiseError.MethodIsNotImplemented(__class__, "AddTopLevelFile")

# --------------------------------------------------------------------
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
assert type(name) == str
assert type(name) == str # noqa: E721
assert name != ""
assert value is not None
RaiseError.MethodIsNotImplemented(__class__, "AddOption")
Expand All @@ -400,7 +400,7 @@ def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
def SetOptionValue(
self, name: str, value: any
) -> PostgresConfigurationSetOptionValueResult:
assert type(name) == str
assert type(name) == str # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValue")

# --------------------------------------------------------------------
Expand All @@ -412,14 +412,14 @@ def SetOptionValue(
# - None if option is not found.
#
def GetOptionValue(self, name: str) -> any:
assert type(name) == str
assert type(name) == str # noqa: E721
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")

# --------------------------------------------------------------------
def SetOptionValueItem(
self, name: str, value_item: any
) -> PostgresConfigurationSetOptionValueResult:
assert type(name) == str
assert type(name) == str # noqa: E721
assert value_item is not None
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValueItem")

Expand Down
54 changes: 27 additions & 27 deletions src/core/bugcheck_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
class BugCheckError:
def UnkObjectDataType(objectType: type):
assert objectType is not None
assert type(objectType) == type
assert type(objectType) == type # noqa: E721

errMsg = "[BUG CHECK] Unknown object data type [{0}].".format(objectType)
raise Exception(errMsg)

# --------------------------------------------------------------------
def MultipleDefOfOptionIsFound(optName: str, count: int):
assert type(optName) == str
assert type(count) == int
assert type(optName) == str # noqa: E721
assert type(count) == int # noqa: E721

errMsg = (
"[BUG CHECK] Multiple definitition of option [{0}] is found - {1}.".format(
Expand All @@ -28,8 +28,8 @@ def MultipleDefOfOptionIsFound(optName: str, count: int):

# --------------------------------------------------------------------
def UnkOptObjectDataType(optName: str, optDataType: type):
assert type(optName) == str
assert type(optDataType) == type
assert type(optName) == str # noqa: E721
assert type(optDataType) == type # noqa: E721

errMsg = (
"[BUG CHECK] Unknown type of the option object data [{0}] - {1}.".format(
Expand All @@ -40,8 +40,8 @@ def UnkOptObjectDataType(optName: str, optDataType: type):

# --------------------------------------------------------------------
def MultipleDefOfFileIsFound(fileName: str, count: int):
assert type(fileName) == str
assert type(count) == int
assert type(fileName) == str # noqa: E721
assert type(count) == int # noqa: E721

errMsg = (
"[BUG CHECK] Multiple definitition of file [{0}] is found - {1}.".format(
Expand All @@ -52,8 +52,8 @@ def MultipleDefOfFileIsFound(fileName: str, count: int):

# --------------------------------------------------------------------
def UnkFileObjectDataType(fileName: str, fileDataType: type):
assert type(fileName) == str
assert type(fileDataType) == type
assert type(fileName) == str # noqa: E721
assert type(fileDataType) == type # noqa: E721

errMsg = "[BUG CHECK] Unknown type of the file object data [{0}] - {1}.".format(
fileName, fileDataType.__name__
Expand All @@ -62,7 +62,7 @@ def UnkFileObjectDataType(fileName: str, fileDataType: type):

# --------------------------------------------------------------------
def UnkFileDataStatus(filePath: str, fileStatus: any):
assert type(filePath) == str
assert type(filePath) == str # noqa: E721
assert fileStatus is not None

errMsg = "[BUG CHECK] Unknown file data status [{0}] - {1}.".format(
Expand All @@ -72,8 +72,8 @@ def UnkFileDataStatus(filePath: str, fileStatus: any):

# --------------------------------------------------------------------
def FileIsNotFoundInIndex(fileKey: str, filePath: str):
assert type(fileKey) == str
assert type(filePath) == str
assert type(fileKey) == str # noqa: E721
assert type(filePath) == str # noqa: E721

errMsg = "[BUG CHECK] File [{0}][{1}] is not found in index.".format(
fileKey, filePath
Expand All @@ -82,14 +82,14 @@ def FileIsNotFoundInIndex(fileKey: str, filePath: str):

# --------------------------------------------------------------------
def OptionIsNotFoundInIndex(optName: str):
assert type(optName) == str
assert type(optName) == str # noqa: E721

errMsg = "[BUG CHECK] Option [{0}] is not found in index.".format(optName)
raise Exception(errMsg)

# --------------------------------------------------------------------
def OptionIsNotFoundInFileLine(optName: str):
assert type(optName) == str
assert type(optName) == str # noqa: E721

errMsg = "[BUG CHECK] Option [{0}] is not found in file line.".format(optName)
raise Exception(errMsg)
Expand All @@ -111,7 +111,7 @@ def FileLineIsNotFoundInFile():

# --------------------------------------------------------------------
def OptionHandlerToPrepareSetValueIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = "[BUG CHECK] OptionHandlerToPrepareSetValue for [{0}] is not defined.".format(
name
Expand All @@ -120,7 +120,7 @@ def OptionHandlerToPrepareSetValueIsNotDefined(name: str):

# --------------------------------------------------------------------
def OptionHandlerToPrepareGetValueIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = "[BUG CHECK] OptionHandlerToPrepareGetValue for [{0}] is not defined.".format(
name
Expand All @@ -129,7 +129,7 @@ def OptionHandlerToPrepareGetValueIsNotDefined(name: str):

# --------------------------------------------------------------------
def OptionHandlerToPrepareSetValueItemIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = "[BUG CHECK] OptionHandlerToPrepareSetValueItem for [{0}] is not defined.".format(
name
Expand All @@ -138,7 +138,7 @@ def OptionHandlerToPrepareSetValueItemIsNotDefined(name: str):

# --------------------------------------------------------------------
def OptionHandlerToSetValueIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = "[BUG CHECK] OptionHandlerToSetValue for [{0}] is not defined.".format(
name
Expand All @@ -147,7 +147,7 @@ def OptionHandlerToSetValueIsNotDefined(name: str):

# --------------------------------------------------------------------
def OptionHandlerToGetValueIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = "[BUG CHECK] OptionHandlerToGetValue for [{0}] is not defined.".format(
name
Expand All @@ -156,7 +156,7 @@ def OptionHandlerToGetValueIsNotDefined(name: str):

# --------------------------------------------------------------------
def OptionHandlerToAddOptionIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = (
"[BUG CHECK] OptionHandlerToAddOption for [{0}] is not defined.".format(
Expand All @@ -167,7 +167,7 @@ def OptionHandlerToAddOptionIsNotDefined(name: str):

# --------------------------------------------------------------------
def OptionHandlerToSetValueItemIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = (
"[BUG CHECK] OptionHandlerToSetValueItem for [{0}] is not defined.".format(
Expand All @@ -178,7 +178,7 @@ def OptionHandlerToSetValueItemIsNotDefined(name: str):

# --------------------------------------------------------------------
def OptionHandlerToWriteIsNotDefined(name: str):
assert type(name) == str
assert type(name) == str # noqa: E721

errMsg = "[BUG CHECK] OptionHandlerToWrite for [{0}] is not defined.".format(
name
Expand All @@ -187,9 +187,9 @@ def OptionHandlerToWriteIsNotDefined(name: str):

# --------------------------------------------------------------------
def UnexpectedSituation(bugcheckSrc: str, bugcheckPoint: str, explain: str):
assert type(bugcheckSrc) == str
assert type(bugcheckPoint) == str
assert explain is None or type(explain) == str
assert type(bugcheckSrc) == str # noqa: E721
assert type(bugcheckPoint) == str # noqa: E721
assert explain is None or type(explain) == str # noqa: E721

errMsg = "[BUG CHECK] Unexpected situation in [{0}][{1}].".format(
bugcheckSrc, bugcheckPoint
Expand All @@ -205,9 +205,9 @@ def UnexpectedSituation(bugcheckSrc: str, bugcheckPoint: str, explain: str):

# --------------------------------------------------------------------
def UnknownOptionValueType(optionName: str, typeOfOptionValue: type):
assert type(optionName) == str
assert type(optionName) == str # noqa: E721
assert optionName != ""
assert type(typeOfOptionValue) == type
assert type(typeOfOptionValue) == type # noqa: E721

errMsg = "[BUG CHECK] Unknown value type [{1}] of option [{0}].".format(
optionName, typeOfOptionValue.__name__
Expand Down
Loading