From 41bade55fe02bfa37654dcce1af3d64fe9e11552 Mon Sep 17 00:00:00 2001 From: tibvdm Date: Wed, 2 Oct 2024 14:20:09 +0200 Subject: [PATCH] fix linting and typing errors --- tested/languages/haskell/config.py | 9 ++++++--- tested/languages/haskell/generators.py | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tested/languages/haskell/config.py b/tested/languages/haskell/config.py index 30cae896..503f0ec0 100644 --- a/tested/languages/haskell/config.py +++ b/tested/languages/haskell/config.py @@ -2,6 +2,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Optional +from tested.configs import GlobalConfig from tested.datatypes import AllTypes from tested.dodona import AnnotateCode, Message from tested.features import Construct, TypeSupport @@ -83,7 +84,7 @@ def supported_constructs(self) -> set[Construct]: Construct.ASSIGNMENTS, Construct.EVALUATION, Construct.GLOBAL_VARIABLES, - Construct.HETEROGENEOUS_ARGUMENTS + Construct.HETEROGENEOUS_ARGUMENTS, } def compilation(self, files: list[str]) -> CallbackResult: @@ -115,7 +116,7 @@ def linter(self, remaining: float) -> tuple[list[Message], list[AnnotateCode]]: return linter.run_hlint(self.config.dodona, remaining) def cleanup_description(self, statement: str) -> str: - return cleanup_description(self, self.clean_types_regex.sub(r'\1', statement)) + return cleanup_description(self, self.clean_types_regex.sub(r"\1", statement)) def cleanup_stacktrace(self, stacktrace: str) -> str: filename = submission_file(self) @@ -169,7 +170,9 @@ def cleanup_stacktrace(self, stacktrace: str) -> str: def generate_statement(self, statement: Statement) -> str: from tested.languages.haskell import generators - return self.clean_types_regex.sub(r'\1', generators.convert_statement(statement)) + return self.clean_types_regex.sub( + r"\1", generators.convert_statement(statement) + ) def generate_execution_unit(self, execution_unit: "PreparedExecutionUnit") -> str: from tested.languages.haskell import generators diff --git a/tested/languages/haskell/generators.py b/tested/languages/haskell/generators.py index c6d8df9b..672b5a63 100644 --- a/tested/languages/haskell/generators.py +++ b/tested/languages/haskell/generators.py @@ -40,6 +40,7 @@ def convert_arguments(arguments: list[Expression]) -> str: return ", ".join(convert_statement(arg) for arg in arguments) + def convert_value(value: Value) -> str: # Handle some advanced types. if value.type == AdvancedSequenceTypes.TUPLE: