diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 023f917d89c..195500f148e 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.4.9 + rev: v0.5.0 hooks: - id: ruff args: diff --git a/homeassistant/components/command_line/notify.py b/homeassistant/components/command_line/notify.py index 1d025726583..14245b72288 100644 --- a/homeassistant/components/command_line/notify.py +++ b/homeassistant/components/command_line/notify.py @@ -42,12 +42,12 @@ class CommandLineNotificationService(BaseNotificationService): def send_message(self, message: str = "", **kwargs: Any) -> None: """Send a message to a command line.""" - with subprocess.Popen( + with subprocess.Popen( # noqa: S602 # shell by design self.command, universal_newlines=True, stdin=subprocess.PIPE, close_fds=False, # required for posix_spawn - shell=True, # noqa: S602 # shell by design + shell=True, ) as proc: try: proc.communicate(input=message, timeout=self._timeout) diff --git a/homeassistant/components/weatherflow_cloud/weather.py b/homeassistant/components/weatherflow_cloud/weather.py index 47e2b6a28df..424a4df4c8e 100644 --- a/homeassistant/components/weatherflow_cloud/weather.py +++ b/homeassistant/components/weatherflow_cloud/weather.py @@ -98,7 +98,6 @@ class WeatherFlowWeather( """Return the Air Pressure @ Station.""" return self.local_data.weather.current_conditions.station_pressure - # @property def humidity(self) -> float | None: """Return the humidity.""" diff --git a/pyproject.toml b/pyproject.toml index f81013aa8b5..d09e4b13d69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -185,6 +185,7 @@ disable = [ "bidirectional-unicode", # PLE2502 "continue-in-finally", # PLE0116 "duplicate-bases", # PLE0241 + "misplaced-bare-raise", # PLE0704 "format-needs-mapping", # F502 "function-redefined", # F811 # Needed because ruff does not understand type of __all__ generated by a function @@ -675,7 +676,7 @@ filterwarnings = [ ] [tool.ruff] -required-version = ">=0.4.8" +required-version = ">=0.5.0" [tool.ruff.lint] select = [ diff --git a/requirements_test_pre_commit.txt b/requirements_test_pre_commit.txt index a7e5c20d86c..c6e629cd129 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.3.0 -ruff==0.4.9 +ruff==0.5.0 yamllint==1.35.1 diff --git a/tests/components/v2c/test_sensor.py b/tests/components/v2c/test_sensor.py index 9e7e3800767..430f91647dd 100644 --- a/tests/components/v2c/test_sensor.py +++ b/tests/components/v2c/test_sensor.py @@ -28,7 +28,7 @@ async def test_sensor( await init_integration(hass, mock_config_entry) await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id) - assert [ + assert _METER_ERROR_OPTIONS == [ "no_error", "communication", "reading", @@ -64,4 +64,4 @@ async def test_sensor( "tcp_head_mismatch", "empty_message", "undefined_error", - ] == _METER_ERROR_OPTIONS + ] diff --git a/tests/components/websocket_api/test_connection.py b/tests/components/websocket_api/test_connection.py index d6c2765522e..5740bb48019 100644 --- a/tests/components/websocket_api/test_connection.py +++ b/tests/components/websocket_api/test_connection.py @@ -2,7 +2,7 @@ import logging from typing import Any -from unittest.mock import AsyncMock, Mock, patch +from unittest.mock import Mock, patch from aiohttp.test_utils import make_mocked_request import pytest @@ -75,7 +75,6 @@ async def test_exception_handling( send_messages = [] user = MockUser() refresh_token = Mock() - current_request = AsyncMock() hass.data[DOMAIN] = {} def get_extra_info(key: str) -> Any: diff --git a/tests/conftest.py b/tests/conftest.py index 161ff458ac0..6f85a7da06e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -892,7 +892,7 @@ def fail_on_log_exception( return def log_exception(format_err, *args): - raise # pylint: disable=misplaced-bare-raise + raise # noqa: PLE0704 monkeypatch.setattr("homeassistant.util.logging.log_exception", log_exception) diff --git a/tests/util/test_process.py b/tests/util/test_process.py index ae28f5d82fc..c6125b656a5 100644 --- a/tests/util/test_process.py +++ b/tests/util/test_process.py @@ -10,9 +10,9 @@ from homeassistant.util import process async def test_kill_process() -> None: """Test killing a process.""" - sleeper = subprocess.Popen( + sleeper = subprocess.Popen( # noqa: S602 # shell by design "sleep 1000", - shell=True, # noqa: S602 # shell by design + shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, )