disko2: Add evaluation for configs and flakes

This commit is contained in:
Felix Uhl committed 2024-10-29 23:50:09 +01:00
1 parent ed506048a4
commit 8acd24950d
8 files changed
+277 -27

No files matched your search

+8 -2
View File
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from typing import Generic, Literal, TypeVar
from typing import Any, Generic, Literal, TypeVar
from lib.logging import DiskoMessage, debug, print_msg
from lib.logging import DiskoMessage, debug, print_msg, MessageCode
T = TypeVar("T", covariant=True)
@@ -19,6 +19,12 @@ class DiskoError:
context: str
success: Literal[False] = False
@classmethod
def single_message(
cls, code: MessageCode, details: dict[str, Any], context: str
) -> "DiskoError":
return cls([DiskoMessage(code, details)], context)
DiskoResult = DiskoSuccess[T] | DiskoError