Bump ruff to 0.5.0 (#120749)
This commit is contained in:
parent
984bbf8851
commit
b56c4a757c
9 changed files with 12 additions and 13 deletions
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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."""
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
]
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue