From ae4cbf5c7e943c4fe8cec4ce5c61f3d711fd83bd Mon Sep 17 00:00:00 2001 From: Aidan Dyga Date: Thu, 21 Nov 2024 20:50:36 -0500 Subject: [PATCH] fix: fixing mypy errors --- gatorgrade/output/check_result.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gatorgrade/output/check_result.py b/gatorgrade/output/check_result.py index 8ccb0161..de696220 100644 --- a/gatorgrade/output/check_result.py +++ b/gatorgrade/output/check_result.py @@ -14,6 +14,7 @@ def __init__( json_info, path: Optional[str] = None, diagnostic: str = "No diagnostic message available", + weight: int = 1, ): """Construct a CheckResult. @@ -23,6 +24,7 @@ def __init__( description: The description to use in output. json_info: the overall information to be included in json output diagnostic: The message to use in output if the check has failed. + weight: The weight of the check. """ self.passed = passed self.description = description @@ -30,9 +32,10 @@ def __init__( self.diagnostic = diagnostic self.path = path self.run_command = "" + self.weight = weight def display_result( - self, show_diagnostic: bool = False, percentage: float = None + self, show_diagnostic: bool = False, percentage: Optional[float] = None ) -> str: """Print check's passed or failed status, description, and, optionally, diagnostic message. @@ -69,7 +72,9 @@ def __str__(self, show_diagnostic: bool = False) -> str: message = self.display_result(show_diagnostic) return message - def print(self, show_diagnostic: bool = False, percentage: float = None) -> None: + def print( + self, show_diagnostic: bool = False, percentage: Optional[float] = None + ) -> None: """Print check's passed or failed status, description, and, optionally, diagnostic message. If no diagnostic message is available, then the output will say so.