mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 10:16:29 +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:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.9.1
|
||||
rev: v0.11.10
|
||||
hooks:
|
||||
- id: ruff
|
||||
args:
|
||||
|
@ -167,7 +167,7 @@ class CoreSys:
|
||||
@property
|
||||
def dev(self) -> bool:
|
||||
"""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
|
||||
def timezone(self) -> str:
|
||||
|
@ -83,7 +83,7 @@ class DockerInfo:
|
||||
"""Return true, if CONFIG_RT_GROUP_SCHED is loaded."""
|
||||
if not Path("/sys/fs/cgroup/cpu/cpu.rt_runtime_us").exists():
|
||||
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):
|
||||
@ -202,7 +202,7 @@ class DockerAPI:
|
||||
if "labels" not in kwargs:
|
||||
kwargs["labels"] = {}
|
||||
elif isinstance(kwargs["labels"], list):
|
||||
kwargs["labels"] = {label: "" for label in kwargs["labels"]}
|
||||
kwargs["labels"] = dict.fromkeys(kwargs["labels"], "")
|
||||
|
||||
kwargs["labels"][LABEL_MANAGED] = ""
|
||||
|
||||
|
@ -103,7 +103,7 @@ def test_not_supported(coresys):
|
||||
def test_is_dev(coresys):
|
||||
"""Test if dev."""
|
||||
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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user