From 31b2becaff83d145ee5b3dcda98621021cbbea37 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2024 12:56:47 +0000 Subject: [PATCH] CI(deps): Update ruff to v0.5.6 (#4126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CI(deps): Update ruff to v0.5.6 * Ignore 6 new issues of shadowing builtins --------- 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/gui_core/query.py | 4 +++- gui/wxpython/gui_core/simplelmgr.py | 6 +++++- pyproject.toml | 19 ++++++++++++------- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-code-quality.yml b/.github/workflows/python-code-quality.yml index 9cd48b27fdc..bd8fc83890b 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.5" + RUFF_VERSION: "0.5.6" runs-on: ${{ matrix.os }} permissions: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47d0cd36bb9..638a1e4787d 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.5 + rev: v0.5.6 hooks: # Run the linter. - id: ruff diff --git a/gui/wxpython/gui_core/query.py b/gui/wxpython/gui_core/query.py index 0dfd21d8765..6250095cb29 100644 --- a/gui/wxpython/gui_core/query.py +++ b/gui/wxpython/gui_core/query.py @@ -148,7 +148,9 @@ def ShowContextMenu(self, node): id = NewId() ids.append(id) self.Bind( - wx.EVT_MENU, lambda evt, t=text[1], id=id: self._copyText(t), id=id + wx.EVT_MENU, + lambda evt, t=text[1], id=id: self._copyText(t), # noqa: A006 + id=id, ) menu.Append(id, text[0]) diff --git a/gui/wxpython/gui_core/simplelmgr.py b/gui/wxpython/gui_core/simplelmgr.py index 9f03a49396e..eb0c0a00688 100644 --- a/gui/wxpython/gui_core/simplelmgr.py +++ b/gui/wxpython/gui_core/simplelmgr.py @@ -159,7 +159,11 @@ def OnContextMenu(self, event): ] for label, text in zip(labels, texts): id = NewId() - self.Bind(wx.EVT_MENU, lambda evt, t=text, id=id: self._copyText(t), id=id) + self.Bind( + wx.EVT_MENU, + lambda evt, t=text, id=id: self._copyText(t), # noqa: A006 + id=id, + ) menu.Append(id, label) diff --git a/pyproject.toml b/pyproject.toml index 3fba3ea0370..18baa5eebac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -227,13 +227,13 @@ ignore = [ "PTH202", # os-path-getsize "PTH204", # os-path-getmtime "PTH207", # glob - "RET501", # unnecessary-return-none - "RET502", # implicit-return-value - "RET503", # implicit-return - "RET505", # superfluous-else-return - "RET506", # superfluous-else-raise - "RET507", # superfluous-else-continue - "RET508", # superfluous-else-break + "RET501", # unnecessary-return-none + "RET502", # implicit-return-value + "RET503", # implicit-return + "RET505", # superfluous-else-return + "RET506", # superfluous-else-raise + "RET507", # superfluous-else-continue + "RET508", # superfluous-else-break "RSE102", # unnecessary-paren-on-raise-exception "RUF002", # ambiguous-unicode-character-docstring "RUF003", # ambiguous-unicode-character-comment @@ -301,6 +301,7 @@ ignore = [ [tool.ruff.lint.per-file-ignores] # See https://docs.astral.sh/ruff/settings/#lint_per-file-ignores +# "A005", # builtin-module-shadowing # "INT002", # f-string-in-get-text-func-call # "INT001", # format-in-get-text-func-call # "INT003", # printf-in-get-text-func-call @@ -326,6 +327,7 @@ ignore = [ "gui/wxpython/iclass/dialogs.py" = ["INT003"] "gui/wxpython/iclass/frame.py" = ["FLY002", "INT003"] "gui/wxpython/iclass/plots.py" = ["INT003"] +"gui/wxpython/iclass/statistics.py" = ["A005"] "gui/wxpython/image2target/ii2t_gis_set.py" = ["INT003"] "gui/wxpython/iscatt/controllers.py" = ["INT003"] "gui/wxpython/iscatt/dialogs.py" = ["INT003"] @@ -352,6 +354,7 @@ ignore = [ "gui/wxpython/web_services/dialogs.py" = ["INT003"] "gui/wxpython/web_services/widgets.py" = ["INT003"] "gui/wxpython/wxgui.py" = ["INT002"] +"gui/wxpython/wxplot/profile.py" = ["A005"] "lib/imagery/testsuite/test_imagery_sigsetfile.py" = ["FURB152"] "lib/init/grass.py" = ["INT003"] "python/grass/__init__.py" = ["PYI056"] @@ -364,11 +367,13 @@ ignore = [ "python/grass/jupyter/tests/reprojection_renderer_test.py" = ["PT013"] "python/grass/jupyter/testsuite/interactivemap_test.py" = ["PGH004"] "python/grass/jupyter/testsuite/map_test.py" = ["PGH004"] +"python/grass/pydispatch/signal.py" = ["A005"] "python/grass/pygrass/raster/category.py" = ["INT002"] "python/grass/pygrass/vector/__init__.py" = ["INT003"] "python/grass/pygrass/vector/geometry.py" = ["PYI024"] "python/grass/pygrass/vector/sql.py" = ["FLY002"] "python/grass/pygrass/vector/testsuite/test_table.py" = ["PLW0108"] +"python/grass/script/array.py" = ["A005"] "python/grass/script/raster.py" = ["INT003"] "python/grass/temporal/abstract_space_time_dataset.py" = ["INT003"] "python/grass/temporal/aggregation.py" = ["INT003"]