Skip to content

Commit

Permalink
style: Fix R1711: Useless return at end of function or method (useles…
Browse files Browse the repository at this point in the history
…s-return) (OSGeo#4892)
  • Loading branch information
echoix authored Dec 27, 2024
1 parent b2b2f93 commit 7f1934f
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions gui/wxpython/animation/anim.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ def SetCallbackOrientationChanged(self, callback):

def Start(self):
if not self.IsActive():
return
pass

def Pause(self, paused):
if not self.IsActive():
return
pass

def Stop(self):
if not self.IsActive():
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/animation/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ def export_avi_callback(event):
del self.busy
if error:
GError(parent=self.frame, message=error)
return

if exportInfo["method"] == "sequence":
filename = os.path.join(
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/photo2image/ip2i_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ def OnGeorectDone(self, **kargs):
"""Print final message"""
global maptype
if maptype == "raster":
return
pass

def OnSettings(self, event):
"""GCP Manager settings"""
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/rdigit/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def OnBackgroundMap(self, event):
ret = grast.raster_info(value)
self._typeChoice.SetStringSelection(ret["datatype"])
except CalledModuleError:
return
pass

def OnOK(self, event):
mapName = self.GetMapName()
Expand Down
3 changes: 1 addition & 2 deletions gui/wxpython/rdigit/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _cellValueChanged(self):
value = float(value)
self._controller.SetCellValue(value)
except ValueError:
return
pass

def _widthValueChanged(self):
value = self._widthValue.GetValue()
Expand All @@ -216,7 +216,6 @@ def _widthValueChanged(self):
self._controller.SetWidthValue(value)
except ValueError:
self._controller.SetWidthValue(0)
return

def _changeDrawColor(self):
color = self._color.GetColour()
Expand Down
1 change: 0 additions & 1 deletion gui/wxpython/rlisetup/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,6 @@ def OnExitPage(self, event: WizardEvent | None = None) -> None:
elif self.region == "draw":
self.SetNext(self.parent.drawsampleframepage)
self.parent.samplingareapage.SetPrev(self.parent.drawsampleframepage)
return


class KeyboardPage(TitledPage):
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ disable = [
"R1704", # Redefining argument with the local name %r (redefined-argument-from-local)
"R1705", # Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
"R1710", # Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
"R1711", # Useless return at end of function or method (useless-return)
"R1712", # Consider using tuple unpacking for swapping variables (consider-swap-variables)
"R1713", # Consider using str.join(sequence) for concatenating strings from an iterable (consider-using-join)
"R1714", # Consider merging these comparisons with 'in' by using '%s %sin (%s)'. Use a set instead if elements are hashable. (consider-using-in)
Expand Down
2 changes: 0 additions & 2 deletions python/grass/pygrass/vector/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,6 @@ def from_wkt(self, wkt):
self.reset()
for coord in match.groups()[0].strip().split(","):
self.append(tuple(float(e) for e in coord.split(" ")))
else:
return None

def buffer(
self,
Expand Down

0 comments on commit 7f1934f

Please sign in to comment.