mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 18:26:30 +00:00
Bump pre-commit ruff to 0.11.10 (#5904)
Bump pre-commit ruff to 0.11.10 and address current issues.
This commit is contained in:
parent
8251b6c61c
commit
73069b628e
@ -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.9.1
|
rev: v0.11.10
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args:
|
args:
|
||||||
|
@ -167,7 +167,7 @@ class CoreSys:
|
|||||||
@property
|
@property
|
||||||
def dev(self) -> bool:
|
def dev(self) -> bool:
|
||||||
"""Return True if we run dev mode."""
|
"""Return True if we run dev mode."""
|
||||||
return bool(os.environ.get(ENV_SUPERVISOR_DEV, 0))
|
return bool(os.environ.get(ENV_SUPERVISOR_DEV) == "1")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def timezone(self) -> str:
|
def timezone(self) -> str:
|
||||||
|
@ -83,7 +83,7 @@ class DockerInfo:
|
|||||||
"""Return true, if CONFIG_RT_GROUP_SCHED is loaded."""
|
"""Return true, if CONFIG_RT_GROUP_SCHED is loaded."""
|
||||||
if not Path("/sys/fs/cgroup/cpu/cpu.rt_runtime_us").exists():
|
if not Path("/sys/fs/cgroup/cpu/cpu.rt_runtime_us").exists():
|
||||||
return False
|
return False
|
||||||
return bool(os.environ.get(ENV_SUPERVISOR_CPU_RT, 0))
|
return bool(os.environ.get(ENV_SUPERVISOR_CPU_RT) == "1")
|
||||||
|
|
||||||
|
|
||||||
class DockerConfig(FileConfiguration):
|
class DockerConfig(FileConfiguration):
|
||||||
@ -202,7 +202,7 @@ class DockerAPI:
|
|||||||
if "labels" not in kwargs:
|
if "labels" not in kwargs:
|
||||||
kwargs["labels"] = {}
|
kwargs["labels"] = {}
|
||||||
elif isinstance(kwargs["labels"], list):
|
elif isinstance(kwargs["labels"], list):
|
||||||
kwargs["labels"] = {label: "" for label in kwargs["labels"]}
|
kwargs["labels"] = dict.fromkeys(kwargs["labels"], "")
|
||||||
|
|
||||||
kwargs["labels"][LABEL_MANAGED] = ""
|
kwargs["labels"][LABEL_MANAGED] = ""
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ def test_not_supported(coresys):
|
|||||||
def test_is_dev(coresys):
|
def test_is_dev(coresys):
|
||||||
"""Test if dev."""
|
"""Test if dev."""
|
||||||
coresys.config.diagnostics = True
|
coresys.config.diagnostics = True
|
||||||
with patch("os.environ", return_value=[("ENV_SUPERVISOR_DEV", "1")]):
|
with patch.dict(os.environ, {"SUPERVISOR_DEV": "1"}):
|
||||||
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
|
assert filter_data(coresys, SAMPLE_EVENT, {}) is None
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user