Skip to content

Commit

Permalink
CI(deps): Update ruff to v0.5.6 (OSGeo#4126)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
renovate[bot] and echoix authored Aug 3, 2024
1 parent a990091 commit 31b2bec
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 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.5"
RUFF_VERSION: "0.5.6"

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.5
rev: v0.5.6
hooks:
# Run the linter.
- id: ruff
Expand Down
4 changes: 3 additions & 1 deletion gui/wxpython/gui_core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
6 changes: 5 additions & 1 deletion gui/wxpython/gui_core/simplelmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
19 changes: 12 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand Down

0 comments on commit 31b2bec

Please sign in to comment.