Skip to content

Commit

Permalink
CI(deps): Update ruff to v0.8.3 (OSGeo#4833)
Browse files Browse the repository at this point in the history
* CI(deps): Update ruff to v0.8.3

* style: Fix if-key-in-dict-del (RUF051)

Ruff rule: https://docs.astral.sh/ruff/rules/if-key-in-dict-del/

When a dictionary's pop() method is used with the second argument (default value), and the second parameter is None, it removes the key from the dict, but doesn't raise a `KeyError` if it didn't exist. The value returned is None.

---------

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 Dec 14, 2024
1 parent a6bc2b9 commit ea0185f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 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.8.0"
# renovate: datasource=pypi depName=ruff
RUFF_VERSION: "0.8.2"
RUFF_VERSION: "0.8.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.8.2
rev: v0.8.3
hooks:
# Run the linter.
- id: ruff
Expand Down
3 changes: 1 addition & 2 deletions gui/wxpython/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,7 @@ def StoreEnvVariable(key, value=None, envFile=None):

# update environmental variables
if value is None:
if key in environ:
del environ[key]
environ.pop(key, None)
else:
environ[key] = value

Expand Down
3 changes: 1 addition & 2 deletions python/grass/pydispatch/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ def __call__(self, *args, **kwargs):
Traceback (most recent call last):
TypeError: mywrite() takes exactly 1 argument (0 given)
"""
if "signal" in kwargs:
del kwargs["signal"]
kwargs.pop("signal", None)
self.emit(*args, **kwargs)


Expand Down

0 comments on commit ea0185f

Please sign in to comment.