Skip to content

Commit

Permalink
fix linting and typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Oct 2, 2024
1 parent ae51fae commit 41bade5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tested/languages/haskell/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tested/languages/haskell/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 41bade5

Please sign in to comment.