[GRASS-git] [OSGeo/grass] 703d9f: style: Fix superfluous-else-return (RET505) (#4459)

Edouard Choinière noreply at github.com
Mon Oct 7 07:53:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 703d9f8bddbc436181c05299d84b18313e1cfb82
      https://github.com/OSGeo/grass/commit/703d9f8bddbc436181c05299d84b18313e1cfb82
  Author: Edouard Choinière <27212526+echoix at users.noreply.github.com>
  Date:   2024-10-07 (Mon, 07 Oct 2024)

  Changed paths:
    M gui/wxpython/animation/dialogs.py
    M gui/wxpython/animation/provider.py
    M gui/wxpython/animation/utils.py
    M gui/wxpython/core/gcmd.py
    M gui/wxpython/core/gconsole.py
    M gui/wxpython/core/gthread.py
    M gui/wxpython/core/menutree.py
    M gui/wxpython/core/render.py
    M gui/wxpython/core/settings.py
    M gui/wxpython/core/toolboxes.py
    M gui/wxpython/core/treemodel.py
    M gui/wxpython/core/utils.py
    M gui/wxpython/datacatalog/tree.py
    M gui/wxpython/dbmgr/base.py
    M gui/wxpython/dbmgr/vinfo.py
    M gui/wxpython/gmodeler/model.py
    M gui/wxpython/gui_core/dialogs.py
    M gui/wxpython/gui_core/forms.py
    M gui/wxpython/gui_core/gselect.py
    M gui/wxpython/gui_core/mapdisp.py
    M gui/wxpython/gui_core/treeview.py
    M gui/wxpython/gui_core/widgets.py
    M gui/wxpython/gui_core/wrap.py
    M gui/wxpython/history/browser.py
    M gui/wxpython/history/tree.py
    M gui/wxpython/image2target/ii2t_gis_set.py
    M gui/wxpython/iscatt/controllers.py
    M gui/wxpython/iscatt/iscatt_core.py
    M gui/wxpython/lmgr/frame.py
    M gui/wxpython/lmgr/giface.py
    M gui/wxpython/lmgr/layertree.py
    M gui/wxpython/location_wizard/wizard.py
    M gui/wxpython/main_window/frame.py
    M gui/wxpython/mapdisp/frame.py
    M gui/wxpython/mapdisp/main.py
    M gui/wxpython/mapdisp/statusbar.py
    M gui/wxpython/mapswipe/dialogs.py
    M gui/wxpython/mapswipe/mapwindow.py
    M gui/wxpython/mapwin/buffered.py
    M gui/wxpython/modules/import_export.py
    M gui/wxpython/nviz/mapwindow.py
    M gui/wxpython/nviz/tools.py
    M gui/wxpython/nviz/wxnviz.py
    M gui/wxpython/psmap/dialogs.py
    M gui/wxpython/psmap/frame.py
    M gui/wxpython/psmap/instructions.py
    M gui/wxpython/psmap/utils.py
    M gui/wxpython/rdigit/controller.py
    M gui/wxpython/rdigit/dialogs.py
    M gui/wxpython/rlisetup/functions.py
    M gui/wxpython/rlisetup/sampling_frame.py
    M gui/wxpython/rlisetup/wizard.py
    M gui/wxpython/startup/locdownload.py
    M gui/wxpython/vdigit/wxdigit.py
    M gui/wxpython/vnet/dialogs.py
    M gui/wxpython/vnet/vnet_core.py
    M gui/wxpython/vnet/vnet_data.py
    M gui/wxpython/web_services/cap_interface.py
    M gui/wxpython/wxplot/histogram.py
    M gui/wxpython/wxplot/profile.py
    M lib/init/grass.py
    M locale/grass_po_stats.py
    M man/build_html.py
    M man/build_manual_gallery.py
    M man/build_rest.py
    M pyproject.toml
    M python/grass/grassdb/checks.py
    M python/grass/gunittest/case.py
    M python/grass/gunittest/multireport.py
    M python/grass/gunittest/multirunner.py
    M python/grass/gunittest/reporters.py
    M python/grass/gunittest/runner.py
    M python/grass/imaging/images2avi.py
    M python/grass/imaging/images2gif.py
    M python/grass/imaging/images2ims.py
    M python/grass/pydispatch/robustapply.py
    M python/grass/pydispatch/saferef.py
    M python/grass/pygrass/errors.py
    M python/grass/pygrass/gis/__init__.py
    M python/grass/pygrass/modules/interface/docstring.py
    M python/grass/pygrass/modules/interface/flag.py
    M python/grass/pygrass/modules/interface/module.py
    M python/grass/pygrass/raster/__init__.py
    M python/grass/pygrass/raster/abstract.py
    M python/grass/pygrass/raster/buffer.py
    M python/grass/pygrass/raster/category.py
    M python/grass/pygrass/utils.py
    M python/grass/pygrass/vector/__init__.py
    M python/grass/pygrass/vector/abstract.py
    M python/grass/pygrass/vector/basic.py
    M python/grass/pygrass/vector/find.py
    M python/grass/pygrass/vector/geometry.py
    M python/grass/pygrass/vector/table.py
    M python/grass/script/core.py
    M python/grass/script/db.py
    M python/grass/script/raster.py
    M python/grass/script/raster3d.py
    M python/grass/script/task.py
    M python/grass/script/utils.py
    M python/grass/temporal/abstract_dataset.py
    M python/grass/temporal/abstract_map_dataset.py
    M python/grass/temporal/abstract_space_time_dataset.py
    M python/grass/temporal/base.py
    M python/grass/temporal/c_libraries_interface.py
    M python/grass/temporal/core.py
    M python/grass/temporal/metadata.py
    M python/grass/temporal/space_time_datasets.py
    M python/grass/temporal/spatial_extent.py
    M python/grass/temporal/temporal_algebra.py
    M python/grass/temporal/temporal_extent.py
    M python/grass/temporal/temporal_granularity.py
    M python/grass/temporal/temporal_raster_base_algebra.py
    M raster/r.topidx/arc_to_gridatb.py
    M scripts/g.extension/g.extension.py
    M scripts/g.search.modules/g.search.modules.py
    M scripts/i.image.mosaic/i.image.mosaic.py
    M scripts/r.in.wms/wms_base.py
    M scripts/r.in.wms/wms_drv.py
    M temporal/t.info/t.info.py
    M utils/g.html2man/g.html2man.py
    M utils/g.html2man/ggroff.py
    M utils/g.html2man/ghtml.py
    M utils/mkhtml.py

  Log Message:
  -----------
  style: Fix superfluous-else-return (RET505) (#4459)

* style: Fix superfluous-else-return (RET505)

Ruff rule: https://docs.astral.sh/ruff/rules/superfluous-else-return/

When there is an if with a return, the next `elif:` or `else:` can be flattened with one less nested level. This kind of early-return pattern is common in C#. Having simpler conditions that return, then the rest of flow continues otherwise

* Apply black



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list