Skip to content

Commit

Permalink
style: Fix not-in-test (E713) and not-is-test (E714) (OSGeo#4011)
Browse files Browse the repository at this point in the history
* style: Fix not-is-test (E714)

* style: Fix not-in-test (E713)
  • Loading branch information
echoix authored and a0x8o committed Jul 23, 2024
1 parent 4fd0d2e commit 2bae762
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions gui/wxpython/gmodeler/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2166,9 +2166,9 @@ def _processData(self):
prompt = param.get("prompt", None)
value = self._filterValue(self._getNodeText(param, "value"))

intermediate = not data.find("intermediate") is None
intermediate = data.find("intermediate") is not None

display = not data.find("display") is None
display = data.find("display") is not None

rels = []
for rel in data.findall("relation"):
Expand Down
6 changes: 3 additions & 3 deletions gui/wxpython/gui_core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ def __init__(self, parent, giface, task, id=wx.ID_ANY, frame=None, *args, **kwar
not_hidden = [
p
for p in self.task.params + self.task.flags
if not p.get("hidden", False) is True
if p.get("hidden", False) is not True
]

self.label_id = [] # wrap titles on resize
Expand Down Expand Up @@ -1057,7 +1057,7 @@ def __init__(self, parent, giface, task, id=wx.ID_ANY, frame=None, *args, **kwar
# flags
#
visible_flags = [
f for f in self.task.flags if not f.get("hidden", False) is True
f for f in self.task.flags if f.get("hidden", False) is not True
]
for f in visible_flags:
# we don't want another help (checkbox appeared in r58783)
Expand Down Expand Up @@ -1124,7 +1124,7 @@ def __init__(self, parent, giface, task, id=wx.ID_ANY, frame=None, *args, **kwar
# parameters
#
visible_params = [
p for p in self.task.params if not p.get("hidden", False) is True
p for p in self.task.params if p.get("hidden", False) is not True
]

try:
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/psmap/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4284,7 +4284,7 @@ def updateRasterLegend(self):
else:
self.rLegendDict["range"] = False

if not self.id[0] in self.instruction:
if self.id[0] not in self.instruction:
rasterLegend = RasterLegend(self.id[0], env=self.env)
self.instruction.AddInstruction(rasterLegend)
self.instruction[self.id[0]].SetInstruction(self.rLegendDict)
Expand Down Expand Up @@ -4404,7 +4404,7 @@ def updateVectorLegend(self):
else:
self.vLegendDict["border"] = "none"

if not self.id[1] in self.instruction:
if self.id[1] not in self.instruction:
vectorLegend = VectorLegend(self.id[1], env=self.env)
self.instruction.AddInstruction(vectorLegend)
self.instruction[self.id[1]].SetInstruction(self.vLegendDict)
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/vnet/vnet_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ def _getInvalidParams(self, params):
except (KeyError, ValueError):
table = None

if not table or not params[col] in list(columnchoices.keys()):
if not table or params[col] not in list(columnchoices.keys()):
invParams.append(col)
continue

Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,6 @@ ignore = [
"DTZ011", # call-date-today
"E401", # multiple-imports-on-one-line
"E402", # module-import-not-at-top-of-file
"E713", # not-in-test
"E714", # not-is-test
"E721", # type-comparison
"E722", # bare-except
"E731", # lambda-assignment
Expand Down

0 comments on commit 2bae762

Please sign in to comment.