1
0
Fork 0

Allow specifying check name and origin when instantiating a CheckResult

This commit is contained in:
Maurizio Porrato 2023-08-17 11:17:04 +01:00
parent e7d6b53a09
commit c0f0798ee8
1 changed files with 9 additions and 4 deletions

View File

@ -13,12 +13,17 @@ class CheckResult:
severity: int = 0
kind: str = "unknown"
check: Optional[str]
origin: Union[Repo, Operator, Bundle, None]
origin: Optional[Union[Repo, Operator, Bundle]]
reason: str
def __init__(self, reason: str):
self.origin = None
self.check = None
def __init__(
self,
reason: str,
check: Optional[str] = None,
origin: Optional[Union[Repo, Operator, Bundle]] = None,
):
self.origin = origin
self.check = check
self.reason = reason
def __str__(self):