Bump ruff to 0.4.3 (#116749)

This commit is contained in:
Sid 2024-05-04 11:56:40 +02:00 committed by GitHub
parent ac0eabad9f
commit a5df229715
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 14 additions and 13 deletions

View File

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2 rev: v0.4.3
hooks: hooks:
- id: ruff - id: ruff
args: args:

View File

@ -651,11 +651,8 @@ def websocket_delete_all_refresh_tokens(
continue continue
try: try:
hass.auth.async_remove_refresh_token(token) hass.auth.async_remove_refresh_token(token)
except Exception as err: # pylint: disable=broad-except except Exception: # pylint: disable=broad-except
getLogger(__name__).exception( getLogger(__name__).exception("Error during refresh token removal")
"During refresh token removal, the following error occurred: %s",
err,
)
remove_failed = True remove_failed = True
if remove_failed: if remove_failed:

View File

@ -659,7 +659,7 @@ filterwarnings = [
] ]
[tool.ruff] [tool.ruff]
required-version = ">=0.4.2" required-version = ">=0.4.3"
[tool.ruff.lint] [tool.ruff.lint]
select = [ select = [

View File

@ -1,5 +1,5 @@
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
codespell==2.2.6 codespell==2.2.6
ruff==0.4.2 ruff==0.4.3
yamllint==1.35.1 yamllint==1.35.1

View File

@ -561,11 +561,15 @@ async def test_ws_delete_all_refresh_tokens_error(
"message": "During removal, an error was raised.", "message": "During removal, an error was raised.",
} }
assert ( records = [
"homeassistant.components.auth", record
logging.ERROR, for record in caplog.records
"During refresh token removal, the following error occurred: I'm bad", if record.msg == "Error during refresh token removal"
) in caplog.record_tuples ]
assert len(records) == 1
assert records[0].levelno == logging.ERROR
assert records[0].exc_info and str(records[0].exc_info[1]) == "I'm bad"
assert records[0].name == "homeassistant.components.auth"
for token in tokens: for token in tokens:
refresh_token = hass.auth.async_get_refresh_token(token["id"]) refresh_token = hass.auth.async_get_refresh_token(token["id"])