Skip to content

Commit

Permalink
CI(deps): Update ruff to v0.5.3 (OSGeo#4073)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
renovate[bot] and echoix authored Jul 18, 2024
1 parent 6fb030f commit daa3b61
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/mapwin/buffered.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/wxplot/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 2 additions & 4 deletions gui/wxpython/wxplot/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit daa3b61

Please sign in to comment.