add SIM lint

This commit is contained in:
Jörg Thalheim
2024-09-02 16:29:50 +02:00
parent a17075f237
commit 483d8ce521
25 changed files with 59 additions and 85 deletions

View File

@@ -12,6 +12,7 @@ Operate on the returned inventory to make changes
- save_inventory: To persist changes.
"""
import contextlib
import json
from pathlib import Path
@@ -163,10 +164,8 @@ def init_inventory(directory: str, init: Inventory | None = None) -> None:
inventory = None
# Try reading the current flake
if init is None:
try:
with contextlib.suppress(ClanCmdError):
inventory = load_inventory_eval(directory)
except ClanCmdError:
pass
if init is not None:
inventory = init