From a452a56e86882ec5054388bfb4470552caa957b8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 22:46:13 +0000 Subject: [PATCH] CI(deps): Update ruff to v0.5.3 (#4073) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CI(deps): Update ruff to v0.5.3 * Apply ruff fixes * Apply black --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com> --- .github/workflows/python-code-quality.yml | 2 +- .pre-commit-config.yaml | 2 +- gui/wxpython/mapwin/buffered.py | 2 +- gui/wxpython/wxplot/histogram.py | 2 +- gui/wxpython/wxplot/profile.py | 6 ++---- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-code-quality.yml b/.github/workflows/python-code-quality.yml index 3e5c454d59c..641f6ba64d0 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)