automatic ruff fixes

This commit is contained in:
Jörg Thalheim
2025-08-25 12:15:13 +02:00
parent 31cbb7dc00
commit b38b10c9a6
6 changed files with 16 additions and 7 deletions

View File

@@ -19,7 +19,8 @@ def list_command(args: argparse.Namespace) -> None:
col_network = max(12, *(len(name) for name in networks))
col_priority = 8
col_module = max(
10, *(len(net.module_name.split(".")[-1]) for net in networks.values())
10,
*(len(net.module_name.split(".")[-1]) for net in networks.values()),
)
col_running = 8

View File

@@ -1146,8 +1146,7 @@ def test_share_mode_switch_regenerates_secret(
monkeypatch: pytest.MonkeyPatch,
flake_with_sops: ClanFlake,
) -> None:
"""
Test that switching a generator from share=false to share=true
"""Test that switching a generator from share=false to share=true
causes the secret to be regenerated with a new value.
"""
flake = flake_with_sops

View File

@@ -555,7 +555,8 @@ class FlakeCacheEntry:
# string and maybe work the same for cache checking
if (selector.type in (SelectorType.STR, SelectorType.MAYBE)) and isinstance(
self.value, dict
self.value,
dict,
):
if not isinstance(selector.value, str):
msg = f"Expected str for STR/MAYBE selector value in caching, got {type(selector.value)}"

View File

@@ -43,7 +43,10 @@ def test_sandbox_denies_write_to_home() -> None:
with sandbox_exec_cmd(script, tmpdir_path) as cmd:
result = subprocess.run(
cmd, check=False, capture_output=True, text=True
cmd,
check=False,
capture_output=True,
text=True,
)
# Check that either the write was denied or the file wasn't created

View File

@@ -172,7 +172,10 @@ class Remote:
]
exit_cmd.append(remote.target)
subprocess.run(
exit_cmd, check=False, capture_output=True, timeout=5
exit_cmd,
check=False,
capture_output=True,
timeout=5,
)
except (subprocess.TimeoutExpired, subprocess.CalledProcessError):
# If exit fails still try to stop the master connection

View File

@@ -134,7 +134,9 @@ def get_machine_disk_schemas(
raw_readme = (disk_template / "README.md").read_text()
frontmatter, readme = extract_frontmatter(
raw_readme, f"{disk_template}/README.md", fm_class=DiskManifest
raw_readme,
f"{disk_template}/README.md",
fm_class=DiskManifest,
)
disk_schemas[schema_name] = DiskSchema(