From a53f876e09fed2f0b7c885e6051e8ae0ac50d7f6 Mon Sep 17 00:00:00 2001 From: Thomas55555 <59625598+Thomas55555@users.noreply.github.com> Date: Fri, 6 Feb 2026 19:39:32 +0100 Subject: [PATCH] Bump ruff to 0.15.0 (#162356) Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- homeassistant/components/mqtt/config_flow.py | 2 +- homeassistant/util/package.py | 2 +- pyproject.toml | 4 +++- requirements_test_pre_commit.txt | 2 +- script/hassfest/docker/Dockerfile | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd7a13183ed..3009adad43a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.13 + rev: v0.15.0 hooks: - id: ruff-check args: diff --git a/homeassistant/components/mqtt/config_flow.py b/homeassistant/components/mqtt/config_flow.py index 8cbc9e1625a..3504972588b 100644 --- a/homeassistant/components/mqtt/config_flow.py +++ b/homeassistant/components/mqtt/config_flow.py @@ -5280,7 +5280,7 @@ async def async_get_broker_settings( # noqa: C901 ) schema = vol.Schema({cv.string: cv.template}) schema(validated_user_input[CONF_WS_HEADERS]) - except (*JSON_DECODE_EXCEPTIONS, vol.MultipleInvalid): + except (*JSON_DECODE_EXCEPTIONS, vol.MultipleInvalid): # fmt: off errors["base"] = "bad_ws_headers" return False return True diff --git a/homeassistant/util/package.py b/homeassistant/util/package.py index 21149f43cb2..f35337c3334 100644 --- a/homeassistant/util/package.py +++ b/homeassistant/util/package.py @@ -233,5 +233,5 @@ async def async_get_installed_packages() -> list[InstalledPackage]: try: return cast(list[InstalledPackage], json_loads_array(stdout.decode())) - except (*JSON_DECODE_EXCEPTIONS, ValueError): + except (*JSON_DECODE_EXCEPTIONS, ValueError): # fmt: off return [] diff --git a/pyproject.toml b/pyproject.toml index 0644a22a5fe..01ac074240e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -675,7 +675,7 @@ exclude_lines = [ ] [tool.ruff] -required-version = ">=0.14.13" +required-version = ">=0.15.0" [tool.ruff.lint] select = [ @@ -784,6 +784,7 @@ select = [ ignore = [ "ASYNC109", # Async function definition with a `timeout` parameter Use `asyncio.timeout` instead "ASYNC110", # Use `asyncio.Event` instead of awaiting `asyncio.sleep` in a `while` loop + "ASYNC240", # Use an async function for entering the file system "D202", # No blank lines allowed after function docstring "D203", # 1 blank line required before class docstring "D213", # Multi-line docstring summary should start at the second line @@ -798,6 +799,7 @@ ignore = [ "PLR0913", # Too many arguments to function call ({c_args} > {max_args}) "PLR0915", # Too many statements ({statements} > {max_statements}) "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable + "PLW0108", # Unnecessary lambda wrapping a function call; can often be replaced by the function itself "PLW1641", # __eq__ without __hash__ "PLW2901", # Outer {outer_kind} variable {name} overwritten by inner {inner_kind} target "PT011", # pytest.raises({exception}) is too broad, set the `match` parameter or use a more specific exception diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index 6ea2dc2c944..67ffbe97597 100644 --- a/requirements_test_pre_commit.txt +++ b/requirements_test_pre_commit.txt @@ -1,5 +1,5 @@ # Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit codespell==2.4.1 -ruff==0.14.13 +ruff==0.15.0 yamllint==1.37.1 diff --git a/script/hassfest/docker/Dockerfile b/script/hassfest/docker/Dockerfile index 927dfdbfae0..3c364d00636 100644 --- a/script/hassfest/docker/Dockerfile +++ b/script/hassfest/docker/Dockerfile @@ -26,7 +26,7 @@ RUN --mount=from=ghcr.io/astral-sh/uv:0.9.26,source=/uv,target=/bin/uv \ -r /usr/src/homeassistant/requirements.txt \ pipdeptree==2.26.1 \ tqdm==4.67.1 \ - ruff==0.14.13 + ruff==0.15.0 LABEL "name"="hassfest" LABEL "maintainer"="Home Assistant "