enable ASYNC, DTZ, YTT and EM lints

This commit is contained in:
Jörg Thalheim
2024-09-02 13:55:46 +02:00
parent d4d7085397
commit e150b37fb8
98 changed files with 526 additions and 421 deletions

View File

@@ -50,9 +50,8 @@ def inspect_flake(flake_url: str | Path, machine_name: str) -> FlakeConfig:
# Check if the machine exists
machines: list[str] = list_nixos_machines(flake_url)
if machine_name not in machines:
raise ClanError(
f"Machine {machine_name} not found in {flake_url}. Available machines: {', '.join(machines)}"
)
msg = f"Machine {machine_name} not found in {flake_url}. Available machines: {', '.join(machines)}"
raise ClanError(msg)
machine = Machine(machine_name, FlakeId(str(flake_url)))
vm = inspect_vm(machine)

View File

@@ -27,8 +27,9 @@ def show_clan_meta(uri: str | Path) -> Meta:
proc = run_no_stdout(cmd)
res = proc.stdout.strip()
except ClanCmdError as e:
msg = "Evaluation failed on meta attribute"
raise ClanError(
"Evaluation failed on meta attribute",
msg,
location=f"show_clan {uri}",
description=str(e.cmd),
) from e
@@ -45,8 +46,9 @@ def show_clan_meta(uri: str | Path) -> Meta:
icon_path = meta_icon
elif scheme in [""]:
if Path(meta_icon).is_absolute():
msg = "Invalid absolute path"
raise ClanError(
"Invalid absolute path",
msg,
location=f"show_clan {uri}",
description="Icon path must be a URL or a relative path.",
)
@@ -54,8 +56,9 @@ def show_clan_meta(uri: str | Path) -> Meta:
else:
icon_path = str((Path(uri) / meta_icon).resolve())
else:
msg = "Invalid schema"
raise ClanError(
"Invalid schema",
msg,
location=f"show_clan {uri}",
description="Icon path must be a URL or a relative path.",
)