Skip to content

Commit e70bd8d

Browse files
fix: E721 suppression is deleted (#16)
* ... is dict * ... is str * ... is int * ... is set * ... is int * ... is bool * ... is list * ... is PgCfgModel__FileLineData * ... is type * ... is PgCfgModel__FileData * ... is PgCfgModel__IncludeData * ... is PgCfgModel__ConfigurationData * ... is PgCfgModel__OptionData * ... is FileData * ... is FileLineData * ... is OptionData * ... is OptionHandlerCtxToGetValue * ... is ConfigurationData * ... is OptionHandlerCtxToSetValue * ... is tagCtx * ... is datetime.datetime * ... is OptionHandlerCtxToWrite * ... is not str * (E721) mix * ... is tuple * ... is PgCfg_Option_Base * ... is OptionHandlerCtxToPrepareSetValue * ... is PgCfgModel__CommentData * ... is PostgresConfigurationOption_Base * ... is PostgresConfigurationSetOptionValueResult_Base * ... is OptionHandlerCtxToPrepareGetValue * ... is PostgresConfigurationFileLine_Base * ... is PgCfg_TopLevelFile_Base * ... is OptionHandlerCtxToPrepareSetValueItem * ... is PgCfgModel__FileLineData.tagItem * ... is PostgresConfigurationComment_Base * ... is PostgresConfigurationFileLines_Base * ... is PgCfg_SetOptionResult_Base * ... is PostgresConfigurationWriterCtx_Base * (E721) mix * ... is ReadUtils__LineReader * ... is __class__.tagOptionHandlers * ... is PgCfg_FileLines_Base * (E721) mix * ... is PgCfg_FileLine_Base * ... is PgCfg_TopLevelFile_Base * ... is PgCfg_Base__AllOptions * ... is PgCfg_FileLinesIterator_Base * ... is PgCfg_Comment_Base * ... is PgCfg_Include_Base * ... is PgCfg_Base__AllFiles * ... is PgCfg_SetOptionEventID * (E721) mix * black * A problem with py3.7 is fixed
1 parent a2dfd33 commit e70bd8d

78 files changed

Lines changed: 1618 additions & 1762 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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 # noqa: E721
84+
assert type(withLineIfLast) is bool
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 # noqa: E721
165+
assert type(withLine) is bool
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 # noqa: E721
186-
assert (offset is None) or (type(offset) == int) # noqa: E721
185+
assert type(text) is str
186+
assert (offset is None) or (type(offset) is int)
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 # noqa: E721
193+
assert type(name) is str
194194
assert name != ""
195195
assert value is not None
196-
assert (offset is None) or (type(offset) == int) # noqa: E721
196+
assert (offset is None) or (type(offset) is int)
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 # noqa: E721
203+
assert type(path) is str
204204
assert path != ""
205-
assert (offset is None) or (type(offset) == int) # noqa: E721
205+
assert (offset is None) or (type(offset) is int)
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 # noqa: E721
274+
assert type(text) is str
275275
RaiseError.MethodIsNotImplemented(__class__, "AddComment")
276276

277277
# --------------------------------------------------------------------
278278
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
279-
assert type(name) == str # noqa: E721
279+
assert type(name) is str
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 # noqa: E721
286+
assert type(path) is str
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 # noqa: E721
304+
assert type(name) is str
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 # noqa: E721
317+
assert type(name) is str
318318
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")
319319

320320
# --------------------------------------------------------------------
321321
def SetOptionValueItem(
322322
self, name: str, value_item: any
323323
) -> PostgresConfigurationSetOptionValueResult:
324-
assert type(name) == str # noqa: E721
324+
assert type(name) is str
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 # noqa: E721
378+
assert type(path) is str
379379
assert path != ""
380380
RaiseError.MethodIsNotImplemented(__class__, "AddTopLevelFile")
381381

382382
# --------------------------------------------------------------------
383383
def AddOption(self, name: str, value: any) -> PostgresConfigurationOption:
384-
assert type(name) == str # noqa: E721
384+
assert type(name) is str
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 # noqa: E721
403+
assert type(name) is str
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 # noqa: E721
415+
assert type(name) is str
416416
RaiseError.MethodIsNotImplemented(__class__, "GetOptionValue")
417417

418418
# --------------------------------------------------------------------
419419
def SetOptionValueItem(
420420
self, name: str, value_item: any
421421
) -> PostgresConfigurationSetOptionValueResult:
422-
assert type(name) == str # noqa: E721
422+
assert type(name) is str
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 # noqa: E721
12+
assert type(objectType) is type
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 # noqa: E721
20-
assert type(count) == int # noqa: E721
19+
assert type(optName) is str
20+
assert type(count) is int
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 # noqa: E721
32-
assert type(optDataType) == type # noqa: E721
31+
assert type(optName) is str
32+
assert type(optDataType) is type
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 # noqa: E721
44-
assert type(count) == int # noqa: E721
43+
assert type(fileName) is str
44+
assert type(count) is int
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 # noqa: E721
56-
assert type(fileDataType) == type # noqa: E721
55+
assert type(fileName) is str
56+
assert type(fileDataType) is type
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 # noqa: E721
65+
assert type(filePath) is str
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 # noqa: E721
76-
assert type(filePath) == str # noqa: E721
75+
assert type(fileKey) is str
76+
assert type(filePath) is str
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 # noqa: E721
85+
assert type(optName) is str
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 # noqa: E721
92+
assert type(optName) is str
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 # noqa: E721
114+
assert type(name) is str
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 # noqa: E721
123+
assert type(name) is str
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 # noqa: E721
132+
assert type(name) is str
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 # noqa: E721
141+
assert type(name) is str
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 # noqa: E721
150+
assert type(name) is str
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 # noqa: E721
159+
assert type(name) is str
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 # noqa: E721
170+
assert type(name) is str
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 # noqa: E721
181+
assert type(name) is str
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 # noqa: E721
191-
assert type(bugcheckPoint) == str # noqa: E721
192-
assert explain is None or type(explain) == str # noqa: E721
190+
assert type(bugcheckSrc) is str
191+
assert type(bugcheckPoint) is str
192+
assert explain is None or type(explain) is str
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 # noqa: E721
208+
assert type(optionName) is str
209209
assert optionName != ""
210-
assert type(typeOfOptionValue) == type # noqa: E721
210+
assert type(typeOfOptionValue) is type
211211

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

0 commit comments

Comments
 (0)