Skip to content

Commit 764dbe2

Browse files
E721 (#14)
* E721 * black
1 parent c6b0a7e commit 764dbe2

35 files changed

Lines changed: 1025 additions & 949 deletions

src/abstract/v00/configuration.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def get_Text(self) -> str:
8181

8282
# --------------------------------------------------------------------
8383
def Delete(self, withLineIfLast: bool):
84-
assert type(withLineIfLast) == bool
84+
assert type(withLineIfLast) == bool # noqa: E721
8585
RaiseError.MethodIsNotImplemented(__class__, "Delete")
8686

8787

@@ -162,7 +162,7 @@ def get_File(self) -> PostgresConfigurationFile:
162162

163163
# --------------------------------------------------------------------
164164
def Delete(self, withLine: bool):
165-
assert type(withLine) == bool
165+
assert type(withLine) == bool # noqa: E721
166166
RaiseError.MethodIsNotImplemented(__class__, "Delete")
167167

168168

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

189189
# --------------------------------------------------------------------
190190
def AddOption(
191191
self, name: str, value: any, offset: typing.Optional[int]
192192
) -> PostgresConfigurationOption:
193-
assert type(name) == str
193+
assert type(name) == str # noqa: E721
194194
assert name != ""
195195
assert value is not None
196-
assert (offset is None) or (type(offset) == int)
196+
assert (offset is None) or (type(offset) == int) # noqa: E721
197197
RaiseError.MethodIsNotImplemented(__class__, "AddOption")
198198

199199
# --------------------------------------------------------------------
200200
def AddInclude(
201201
self, path: str, offset: typing.Optional[int]
202202
) -> PostgresConfigurationInclude:
203-
assert type(path) == str
203+
assert type(path) == str # noqa: E721
204204
assert path != ""
205-
assert (offset is None) or (type(offset) == int)
205+
assert (offset is None) or (type(offset) == int) # noqa: E721
206206
RaiseError.MethodIsNotImplemented(__class__, "AddInclude")
207207

208208
# --------------------------------------------------------------------
@@ -271,19 +271,19 @@ def AddEmptyLine(self) -> PostgresConfigurationFileLine:
271271

272272
# --------------------------------------------------------------------
273273
def AddComment(self, text: str) -> PostgresConfigurationComment:
274-
assert type(text) == str
274+
assert type(text) == str # noqa: E721
275275
RaiseError.MethodIsNotImplemented(__class__, "AddComment")
276276

277277
# --------------------------------------------------------------------
278278
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
279-
assert type(name) == str
279+
assert type(name) == str # noqa: E721
280280
assert name != ""
281281
assert value is not None
282282
RaiseError.MethodIsNotImplemented(__class__, "AddOption")
283283

284284
# --------------------------------------------------------------------
285285
def AddInclude(self, path: str) -> PostgresConfigurationInclude:
286-
assert type(path) == str
286+
assert type(path) == str # noqa: E721
287287
assert path != ""
288288
RaiseError.MethodIsNotImplemented(__class__, "AddInclude")
289289

@@ -301,7 +301,7 @@ def AddInclude(self, path: str) -> PostgresConfigurationInclude:
301301
def SetOptionValue(
302302
self, name: str, value: any
303303
) -> PostgresConfigurationSetOptionValueResult:
304-
assert type(name) == str
304+
assert type(name) == str # noqa: E721
305305
assert name != ""
306306
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValue")
307307

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

320320
# --------------------------------------------------------------------
321321
def SetOptionValueItem(
322322
self, name: str, value_item: any
323323
) -> PostgresConfigurationSetOptionValueResult:
324-
assert type(name) == str
324+
assert type(name) == str # noqa: E721
325325
assert name != ""
326326
assert value_item is not None
327327
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValueItem")
@@ -375,13 +375,13 @@ def __init__(self):
375375

376376
# interface ----------------------------------------------------------
377377
def AddTopLevelFile(self, path: str) -> PostgresConfigurationFile:
378-
assert type(path) == str
378+
assert type(path) == str # noqa: E721
379379
assert path != ""
380380
RaiseError.MethodIsNotImplemented(__class__, "AddTopLevelFile")
381381

382382
# --------------------------------------------------------------------
383383
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
384-
assert type(name) == str
384+
assert type(name) == str # noqa: E721
385385
assert name != ""
386386
assert value is not None
387387
RaiseError.MethodIsNotImplemented(__class__, "AddOption")
@@ -400,7 +400,7 @@ def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
400400
def SetOptionValue(
401401
self, name: str, value: any
402402
) -> PostgresConfigurationSetOptionValueResult:
403-
assert type(name) == str
403+
assert type(name) == str # noqa: E721
404404
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValue")
405405

406406
# --------------------------------------------------------------------
@@ -412,14 +412,14 @@ def SetOptionValue(
412412
# - None if option is not found.
413413
#
414414
def GetOptionValue(self, name: str) -> any:
415-
assert type(name) == str
415+
assert type(name) == str # noqa: E721
416416
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")
417417

418418
# --------------------------------------------------------------------
419419
def SetOptionValueItem(
420420
self, name: str, value_item: any
421421
) -> PostgresConfigurationSetOptionValueResult:
422-
assert type(name) == str
422+
assert type(name) == str # noqa: E721
423423
assert value_item is not None
424424
RaiseError.MethodIsNotImplemented(__class__, "SetOptionValueItem")
425425

src/core/bugcheck_error.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
class BugCheckError:
1010
def UnkObjectDataType(objectType: type):
1111
assert objectType is not None
12-
assert type(objectType) == type
12+
assert type(objectType) == type # noqa: E721
1313

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

1717
# --------------------------------------------------------------------
1818
def MultipleDefOfOptionIsFound(optName: str, count: int):
19-
assert type(optName) == str
20-
assert type(count) == int
19+
assert type(optName) == str # noqa: E721
20+
assert type(count) == int # noqa: E721
2121

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

2929
# --------------------------------------------------------------------
3030
def UnkOptObjectDataType(optName: str, optDataType: type):
31-
assert type(optName) == str
32-
assert type(optDataType) == type
31+
assert type(optName) == str # noqa: E721
32+
assert type(optDataType) == type # noqa: E721
3333

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

4141
# --------------------------------------------------------------------
4242
def MultipleDefOfFileIsFound(fileName: str, count: int):
43-
assert type(fileName) == str
44-
assert type(count) == int
43+
assert type(fileName) == str # noqa: E721
44+
assert type(count) == int # noqa: E721
4545

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

5353
# --------------------------------------------------------------------
5454
def UnkFileObjectDataType(fileName: str, fileDataType: type):
55-
assert type(fileName) == str
56-
assert type(fileDataType) == type
55+
assert type(fileName) == str # noqa: E721
56+
assert type(fileDataType) == type # noqa: E721
5757

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

6363
# --------------------------------------------------------------------
6464
def UnkFileDataStatus(filePath: str, fileStatus: any):
65-
assert type(filePath) == str
65+
assert type(filePath) == str # noqa: E721
6666
assert fileStatus is not None
6767

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

7373
# --------------------------------------------------------------------
7474
def FileIsNotFoundInIndex(fileKey: str, filePath: str):
75-
assert type(fileKey) == str
76-
assert type(filePath) == str
75+
assert type(fileKey) == str # noqa: E721
76+
assert type(filePath) == str # noqa: E721
7777

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

8383
# --------------------------------------------------------------------
8484
def OptionIsNotFoundInIndex(optName: str):
85-
assert type(optName) == str
85+
assert type(optName) == str # noqa: E721
8686

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

9090
# --------------------------------------------------------------------
9191
def OptionIsNotFoundInFileLine(optName: str):
92-
assert type(optName) == str
92+
assert type(optName) == str # noqa: E721
9393

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

112112
# --------------------------------------------------------------------
113113
def OptionHandlerToPrepareSetValueIsNotDefined(name: str):
114-
assert type(name) == str
114+
assert type(name) == str # noqa: E721
115115

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

121121
# --------------------------------------------------------------------
122122
def OptionHandlerToPrepareGetValueIsNotDefined(name: str):
123-
assert type(name) == str
123+
assert type(name) == str # noqa: E721
124124

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

130130
# --------------------------------------------------------------------
131131
def OptionHandlerToPrepareSetValueItemIsNotDefined(name: str):
132-
assert type(name) == str
132+
assert type(name) == str # noqa: E721
133133

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

139139
# --------------------------------------------------------------------
140140
def OptionHandlerToSetValueIsNotDefined(name: str):
141-
assert type(name) == str
141+
assert type(name) == str # noqa: E721
142142

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

148148
# --------------------------------------------------------------------
149149
def OptionHandlerToGetValueIsNotDefined(name: str):
150-
assert type(name) == str
150+
assert type(name) == str # noqa: E721
151151

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

157157
# --------------------------------------------------------------------
158158
def OptionHandlerToAddOptionIsNotDefined(name: str):
159-
assert type(name) == str
159+
assert type(name) == str # noqa: E721
160160

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

168168
# --------------------------------------------------------------------
169169
def OptionHandlerToSetValueItemIsNotDefined(name: str):
170-
assert type(name) == str
170+
assert type(name) == str # noqa: E721
171171

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

179179
# --------------------------------------------------------------------
180180
def OptionHandlerToWriteIsNotDefined(name: str):
181-
assert type(name) == str
181+
assert type(name) == str # noqa: E721
182182

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

188188
# --------------------------------------------------------------------
189189
def UnexpectedSituation(bugcheckSrc: str, bugcheckPoint: str, explain: str):
190-
assert type(bugcheckSrc) == str
191-
assert type(bugcheckPoint) == str
192-
assert explain is None or type(explain) == str
190+
assert type(bugcheckSrc) == str # noqa: E721
191+
assert type(bugcheckPoint) == str # noqa: E721
192+
assert explain is None or type(explain) == str # noqa: E721
193193

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

206206
# --------------------------------------------------------------------
207207
def UnknownOptionValueType(optionName: str, typeOfOptionValue: type):
208-
assert type(optionName) == str
208+
assert type(optionName) == str # noqa: E721
209209
assert optionName != ""
210-
assert type(typeOfOptionValue) == type
210+
assert type(typeOfOptionValue) == type # noqa: E721
211211

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

0 commit comments

Comments
 (0)