diff --git a/.github/workflows/python-code-quality.yml b/.github/workflows/python-code-quality.yml index 81f74056f9d..b1c7dd8391a 100644 --- a/.github/workflows/python-code-quality.yml +++ b/.github/workflows/python-code-quality.yml @@ -36,7 +36,7 @@ jobs: # renovate: datasource=pypi depName=bandit BANDIT_VERSION: "1.7.9" # renovate: datasource=pypi depName=ruff - RUFF_VERSION: "0.5.2" + RUFF_VERSION: "0.5.3" runs-on: ${{ matrix.os }} permissions: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9843a6f6616..143ab87d44e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: ) - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.5.2 + rev: v0.5.3 hooks: # Run the linter. - id: ruff diff --git a/gui/wxpython/mapwin/buffered.py b/gui/wxpython/mapwin/buffered.py index 6ce7f98731e..e0442ed94ae 100644 --- a/gui/wxpython/mapwin/buffered.py +++ b/gui/wxpython/mapwin/buffered.py @@ -1127,7 +1127,7 @@ def DragMap(self, moveto): def DragItem(self, id, coords): """Drag an overlay decoration item""" - if id == 99 or id == "" or id is None: + if id in (99, "") or id is None: return Debug.msg(5, "BufferedWindow.DragItem(): id=%d" % id) x, y = self.lastpos diff --git a/gui/wxpython/wxplot/histogram.py b/gui/wxpython/wxplot/histogram.py index 1c7d4bf21d9..f8319747dab 100644 --- a/gui/wxpython/wxplot/histogram.py +++ b/gui/wxpython/wxplot/histogram.py @@ -154,7 +154,7 @@ def SetupHistogram(self): # set xlabel based on first raster map in list to be histogrammed # units = self.raster[self.rasterList[0]]["units"] - if units != "" and units != "(none)" and units is not None: + if units not in ("", "(none)") and units is not None: self.xlabel = _("Raster cell values %s") % units else: self.xlabel = _("Raster cell values") diff --git a/gui/wxpython/wxplot/profile.py b/gui/wxpython/wxplot/profile.py index 1e79379b08b..1d3de6681af 100644 --- a/gui/wxpython/wxplot/profile.py +++ b/gui/wxpython/wxplot/profile.py @@ -313,11 +313,9 @@ def CreateDatalist(self, raster, coords): dist, elev = line.strip().split(" ") if ( dist is None - or dist == "" - or dist == "nan" + or dist in ("", "nan") or elev is None - or elev == "" - or elev == "nan" + or elev in ("", "nan") ): continue dist = float(dist)