Compare commits
	
		
			No commits in common. "ba456cf7f012709ca26052ae40aabfa7a0c3e759" and "e775992e5da4a53c131599638cd16b2d174afef5" have entirely different histories.
		
	
	
		
			ba456cf7f0
			...
			e775992e5d
		
	
		
| 
						 | 
				
			
			@ -30,7 +30,6 @@ jobs:
 | 
			
		|||
        run: |
 | 
			
		||||
          pdm run coverage
 | 
			
		||||
      - name: Upload Coverage to Codacy
 | 
			
		||||
        if: github.ref == 'refs/heads/master'
 | 
			
		||||
        env:
 | 
			
		||||
          CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
 | 
			
		||||
        run: |
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
from pathlib import Path
 | 
			
		||||
from typing import Tuple, Type, cast
 | 
			
		||||
from typing import Tuple
 | 
			
		||||
 | 
			
		||||
import inquirer
 | 
			
		||||
import tomli
 | 
			
		||||
| 
						 | 
				
			
			@ -10,15 +10,8 @@ from joj3_config_generator.models import answer, joj1, repo, task
 | 
			
		|||
 | 
			
		||||
def load_joj3_task_toml_answers() -> answer.Answers:
 | 
			
		||||
    name = inquirer.text("What's the task name?", default="hw0")
 | 
			
		||||
    language = inquirer.list_input(
 | 
			
		||||
        "What's the language?", choices=[(cls.name, cls) for cls in answer.LANGUAGES]
 | 
			
		||||
    )
 | 
			
		||||
    language = cast(Type[answer.LanguageInterface], language)
 | 
			
		||||
    if inquirer.confirm("Load content from templates?", default=True):
 | 
			
		||||
        answers = inquirer.prompt(language.get_template_questions())
 | 
			
		||||
        template_file_content: str = answers["template_file_content"]
 | 
			
		||||
        return answer.Answers(
 | 
			
		||||
            name=name, language=language, template_file_content=template_file_content
 | 
			
		||||
    language: answer.LanguageInterface = inquirer.list_input(
 | 
			
		||||
        "What's the language?", choices=answer.LANGUAGES
 | 
			
		||||
    )
 | 
			
		||||
    stages = inquirer.checkbox(
 | 
			
		||||
        "What's the stages?",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,14 +1,14 @@
 | 
			
		|||
from abc import ABC, abstractmethod
 | 
			
		||||
from enum import Enum
 | 
			
		||||
from importlib import resources
 | 
			
		||||
from typing import Any, ClassVar, Dict, List, Type
 | 
			
		||||
from typing import Any, ClassVar, Dict, List
 | 
			
		||||
 | 
			
		||||
import inquirer
 | 
			
		||||
from pydantic import BaseModel, ConfigDict
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class LanguageInterface(ABC):
 | 
			
		||||
    name: ClassVar[str]
 | 
			
		||||
    @abstractmethod
 | 
			
		||||
    def __str__(self) -> str: ...
 | 
			
		||||
 | 
			
		||||
    @abstractmethod
 | 
			
		||||
    class Stage(str, Enum): ...
 | 
			
		||||
| 
						 | 
				
			
			@ -31,25 +31,10 @@ class LanguageInterface(ABC):
 | 
			
		|||
    @abstractmethod
 | 
			
		||||
    def get_attribute_questions(cls) -> List[Any]: ...
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def get_template_questions(cls) -> List[Any]:
 | 
			
		||||
        anchor = "joj3_config_generator.templates"
 | 
			
		||||
        templates_dir = resources.files(anchor).joinpath(cls.name)
 | 
			
		||||
        choices = []
 | 
			
		||||
        for entry in templates_dir.iterdir():
 | 
			
		||||
            if entry.is_file() and entry.name.endswith(".toml"):
 | 
			
		||||
                choices.append((entry.name, entry.read_text()))
 | 
			
		||||
        return [
 | 
			
		||||
            inquirer.List(
 | 
			
		||||
                "template_file_content",
 | 
			
		||||
                message="Which template file do you want?",
 | 
			
		||||
                choices=choices,
 | 
			
		||||
            ),
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Cpp(LanguageInterface):
 | 
			
		||||
    name = "C++"
 | 
			
		||||
    def __str__(self) -> str:
 | 
			
		||||
        return "C++"
 | 
			
		||||
 | 
			
		||||
    class Stage(str, Enum):
 | 
			
		||||
        COMPILATION = "Compilation"
 | 
			
		||||
| 
						 | 
				
			
			@ -67,23 +52,23 @@ class Cpp(LanguageInterface):
 | 
			
		|||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def get_attribute_questions(cls) -> List[Any]:
 | 
			
		||||
        attribute: Cpp.Attribute = cls.attribute
 | 
			
		||||
        return [
 | 
			
		||||
            inquirer.Text(
 | 
			
		||||
                name="compile_command",
 | 
			
		||||
                message="Compile command",
 | 
			
		||||
                default=attribute.compile_command,
 | 
			
		||||
                default=cls.attribute.compile_command,
 | 
			
		||||
            ),
 | 
			
		||||
            inquirer.Text(
 | 
			
		||||
                name="run_command",
 | 
			
		||||
                message="Run command",
 | 
			
		||||
                default=attribute.run_command,
 | 
			
		||||
                default=cls.attribute.run_command,
 | 
			
		||||
            ),
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Python(LanguageInterface):
 | 
			
		||||
    name = "Python"
 | 
			
		||||
    def __str__(self) -> str:
 | 
			
		||||
        return "Python"
 | 
			
		||||
 | 
			
		||||
    class Stage(str, Enum):
 | 
			
		||||
        RUN = "Run"
 | 
			
		||||
| 
						 | 
				
			
			@ -96,18 +81,18 @@ class Python(LanguageInterface):
 | 
			
		|||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def get_attribute_questions(cls) -> List[Any]:
 | 
			
		||||
        attribute: Python.Attribute = cls.attribute
 | 
			
		||||
        return [
 | 
			
		||||
            inquirer.Text(
 | 
			
		||||
                name="run_command",
 | 
			
		||||
                message="Run command",
 | 
			
		||||
                default=attribute.run_command,
 | 
			
		||||
                default=cls.attribute.run_command,
 | 
			
		||||
            ),
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Rust(LanguageInterface):
 | 
			
		||||
    name = "Rust"
 | 
			
		||||
    def __str__(self) -> str:
 | 
			
		||||
        return "Rust"
 | 
			
		||||
 | 
			
		||||
    class Stage(str, Enum):
 | 
			
		||||
        COMPILATION = "Compilation"
 | 
			
		||||
| 
						 | 
				
			
			@ -122,20 +107,18 @@ class Rust(LanguageInterface):
 | 
			
		|||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def get_attribute_questions(cls) -> List[Any]:
 | 
			
		||||
        attribute: Rust.Attribute = cls.attribute
 | 
			
		||||
        return []
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
LANGUAGES: List[Type[LanguageInterface]] = [
 | 
			
		||||
    Cpp,
 | 
			
		||||
    Python,
 | 
			
		||||
    Rust,
 | 
			
		||||
LANGUAGES = [
 | 
			
		||||
    Cpp(),
 | 
			
		||||
    Python(),
 | 
			
		||||
    Rust(),
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Answers(BaseModel):
 | 
			
		||||
    name: str
 | 
			
		||||
    language: Type[LanguageInterface]
 | 
			
		||||
    template_file_content: str = ""
 | 
			
		||||
    language: LanguageInterface
 | 
			
		||||
 | 
			
		||||
    model_config = ConfigDict(arbitrary_types_allowed=True)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ from pathlib import Path
 | 
			
		|||
from joj3_config_generator.models.common import Memory, Time
 | 
			
		||||
 | 
			
		||||
DEFAULT_CPU_LIMIT = Time("1s")
 | 
			
		||||
DEFAULT_MEMORY_LIMIT = Memory("256m")
 | 
			
		||||
DEFAULT_MEMORY_LIMIT = Memory("128m")
 | 
			
		||||
DEFAULT_FILE_LIMIT = Memory("32m")
 | 
			
		||||
 | 
			
		||||
JOJ3_CONFIG_ROOT = Path("/home/tt/.config/joj")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,13 +0,0 @@
 | 
			
		|||
[[stages]]
 | 
			
		||||
name = "[cq] Clang-tidy"
 | 
			
		||||
command = "run-clang-tidy-18 -header-filter=.* -quiet -load=/usr/local/lib/libcodequality.so -p h7/build h7/ex2.cpp"
 | 
			
		||||
files.import = [ "tests/homework/h7/.clang-tidy", "h7/build/compile_commands.json" ]
 | 
			
		||||
limit.stdout = "65m"
 | 
			
		||||
 | 
			
		||||
parsers = [ "clangtidy", "result-detail" ]
 | 
			
		||||
clangtidy.keyword = [ "codequality-unchecked-malloc-result", "codequality-no-global-variables", "codequality-no-header-guard", "codequality-no-fflush-stdin", "readability-function-size", "readability-duplicate-include", "readability-identifier-naming", "readability-redundant", "readability-misleading-indentation", "readability-misplaced-array-index", "cppcoreguidelines-init-variables", "bugprone-suspicious-string-compare", "google-global-names-in-headers", "clang-diagnostic", "clang-analyzer", "misc", "performance", "portability" ]
 | 
			
		||||
clangtidy.weight = [ 5, 20, 20, 20, 10, 5, 5, 5, 15, 5, 5, 5, 5, 5, 5, 5, 5, 5]
 | 
			
		||||
result-detail.exitstatus = true
 | 
			
		||||
result-detail.stdout = true
 | 
			
		||||
result-detail.time = false
 | 
			
		||||
result-detail.mem = false
 | 
			
		||||
| 
						 | 
				
			
			@ -1,12 +0,0 @@
 | 
			
		|||
[[stages]]
 | 
			
		||||
name = "[cq] Cppcheck"
 | 
			
		||||
command = "cppcheck --template='{\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}' --force --enable=all --suppress=missingIncludeSystem  --quiet h7/ex2.cpp"
 | 
			
		||||
limit.stderr = "65m"
 | 
			
		||||
 | 
			
		||||
parsers = [ "cppcheck", "result-detail" ]
 | 
			
		||||
cppcheck.keyword = ["error", "warning", "portability", "performance", "style"]
 | 
			
		||||
cppcheck.weight = [15, 5, 5, 5, 5]
 | 
			
		||||
result-detail.exitstatus = true
 | 
			
		||||
result-detail.stderr = true
 | 
			
		||||
result-detail.time = false
 | 
			
		||||
result-detail.mem = false
 | 
			
		||||
| 
						 | 
				
			
			@ -1,12 +0,0 @@
 | 
			
		|||
[[stages]]
 | 
			
		||||
name = "[cq] Cpplint"
 | 
			
		||||
command = "cpplint --linelength=120 --filter=-legal,-readability/casting,-whitespace,-runtime/printf,-runtime/threadsafe_fn,-runtime/int,-readability/todo,-build/include_subdir,-build/header_guard,-build/include_what_you_use --recursive --exclude=build h7/ex2.cpp"
 | 
			
		||||
limit.stdout = "65m"
 | 
			
		||||
 | 
			
		||||
parsers = ["cpplint", "result-detail"]
 | 
			
		||||
cpplint.keyword = ["runtime", "readability", "build"]
 | 
			
		||||
cpplint.weight = [5, 20, 10]
 | 
			
		||||
result-detail.exitstatus = true
 | 
			
		||||
result-detail.stderr = true
 | 
			
		||||
result-detail.time = false
 | 
			
		||||
result-detail.mem = false
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
[[stages]]
 | 
			
		||||
name = "Run"
 | 
			
		||||
command = "python3 main.py"
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
[[stages]]
 | 
			
		||||
name = "Run"
 | 
			
		||||
command = "cargo run"
 | 
			
		||||
| 
						 | 
				
			
			@ -1,27 +1,19 @@
 | 
			
		|||
from typing import Any, Callable, Dict, List, Type
 | 
			
		||||
 | 
			
		||||
import tomli
 | 
			
		||||
 | 
			
		||||
from joj3_config_generator.models import answer, task
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_task_conf_from_answers(answers: answer.Answers) -> task.Config:
 | 
			
		||||
    if answers.template_file_content:
 | 
			
		||||
        toml_dict = tomli.loads(answers.template_file_content)
 | 
			
		||||
        return task.Config(
 | 
			
		||||
            task=task.Task(name=answers.name),
 | 
			
		||||
            stages=toml_dict["stages"],
 | 
			
		||||
        )
 | 
			
		||||
    language = answers.language
 | 
			
		||||
    transformer_dict = get_transformer_dict()
 | 
			
		||||
    transformer = transformer_dict[language]
 | 
			
		||||
    transformer = transformer_dict[type(language)]
 | 
			
		||||
    stages = transformer(language)
 | 
			
		||||
    return task.Config(task=task.Task(name=answers.name), stages=stages)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def get_transformer_dict() -> Dict[
 | 
			
		||||
    Type[answer.LanguageInterface],
 | 
			
		||||
    Callable[[Type[Any]], List[task.Stage]],
 | 
			
		||||
    Type[Any],
 | 
			
		||||
    Callable[[Any], List[task.Stage]],
 | 
			
		||||
]:
 | 
			
		||||
    return {
 | 
			
		||||
        answer.Cpp: get_cpp_stages,
 | 
			
		||||
| 
						 | 
				
			
			@ -31,7 +23,7 @@ def get_transformer_dict() -> Dict[
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# TODO: implement
 | 
			
		||||
def get_cpp_stages(language: Type[answer.Cpp]) -> List[task.Stage]:
 | 
			
		||||
def get_cpp_stages(language: answer.Cpp) -> List[task.Stage]:
 | 
			
		||||
    stages = language.stages
 | 
			
		||||
    attribute: answer.Cpp.Attribute = language.attribute
 | 
			
		||||
    task_stages = []
 | 
			
		||||
| 
						 | 
				
			
			@ -47,14 +39,14 @@ def get_cpp_stages(language: Type[answer.Cpp]) -> List[task.Stage]:
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
# TODO: implement
 | 
			
		||||
def get_python_stages(language: Type[answer.Python]) -> List[task.Stage]:
 | 
			
		||||
def get_python_stages(language: answer.Python) -> List[task.Stage]:
 | 
			
		||||
    stages = language.stages
 | 
			
		||||
    attribute: answer.Python.Attribute = language.attribute
 | 
			
		||||
    return []
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# TODO: implement
 | 
			
		||||
def get_rust_stages(language: Type[answer.Rust]) -> List[task.Stage]:
 | 
			
		||||
def get_rust_stages(language: answer.Rust) -> List[task.Stage]:
 | 
			
		||||
    stages = language.stages
 | 
			
		||||
    attribute: answer.Rust.Attribute = language.attribute
 | 
			
		||||
    return []
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@ import hashlib
 | 
			
		|||
from pathlib import Path
 | 
			
		||||
from typing import List
 | 
			
		||||
 | 
			
		||||
from joj3_config_generator.models import common, repo, result
 | 
			
		||||
from joj3_config_generator.models import repo, result
 | 
			
		||||
from joj3_config_generator.models.const import TEAPOT_CONFIG_ROOT, TEAPOT_LOG_PATH
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -25,8 +25,6 @@ def get_teapot_stage(repo_conf: repo.Config) -> result.StageDetail:
 | 
			
		|||
                default=result.Cmd(
 | 
			
		||||
                    args=args,
 | 
			
		||||
                    env=[f"LOG_FILE_PATH={TEAPOT_LOG_PATH}"],
 | 
			
		||||
                    cpu_limit=common.Time("30s"),
 | 
			
		||||
                    clock_limit=common.Time("60s"),
 | 
			
		||||
                ),
 | 
			
		||||
                cases=[],
 | 
			
		||||
            ),
 | 
			
		||||
| 
						 | 
				
			
			@ -73,9 +71,7 @@ def get_health_check_stage(repo_conf: repo.Config) -> result.StageDetail:
 | 
			
		|||
        executor=result.Executor(
 | 
			
		||||
            name="local",
 | 
			
		||||
            with_=result.ExecutorWith(
 | 
			
		||||
                default=result.Cmd(
 | 
			
		||||
                    cpu_limit=common.Time("10s"), clock_limit=common.Time("20s")
 | 
			
		||||
                ),
 | 
			
		||||
                default=result.Cmd(),
 | 
			
		||||
                cases=[
 | 
			
		||||
                    result.OptionalCmd(
 | 
			
		||||
                        args=get_health_check_args(repo_conf),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,9 +32,9 @@
 | 
			
		|||
                                "max": 33554432,
 | 
			
		||||
                                "pipe": true
 | 
			
		||||
                            },
 | 
			
		||||
                            "cpuLimit": 10000000000,
 | 
			
		||||
                            "clockLimit": 20000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			@ -124,7 +124,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			@ -211,7 +211,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			@ -311,7 +311,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			@ -437,7 +437,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			@ -582,7 +582,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			@ -806,9 +806,9 @@
 | 
			
		|||
                                "max": 33554432,
 | 
			
		||||
                                "pipe": true
 | 
			
		||||
                            },
 | 
			
		||||
                            "cpuLimit": 30000000000,
 | 
			
		||||
                            "clockLimit": 60000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,7 +42,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -41,7 +41,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,7 +40,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,7 +40,7 @@
 | 
			
		|||
                            },
 | 
			
		||||
                            "cpuLimit": 1000000000,
 | 
			
		||||
                            "clockLimit": 2000000000,
 | 
			
		||||
                            "memoryLimit": 268435456,
 | 
			
		||||
                            "memoryLimit": 134217728,
 | 
			
		||||
                            "stackLimit": 0,
 | 
			
		||||
                            "procLimit": 50,
 | 
			
		||||
                            "cpuRateLimit": 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ def load_case(case_name: str) -> None:
 | 
			
		|||
    answers_json_path = root / case_name / "answers.json"
 | 
			
		||||
    task_toml_path = root / case_name / "task.toml"
 | 
			
		||||
    answers_dict = json.loads(answers_json_path.read_text())
 | 
			
		||||
    language = next(x for x in answer.LANGUAGES if x.name == answers_dict["language"])
 | 
			
		||||
    language = next(x for x in answer.LANGUAGES if str(x) == answers_dict["language"])
 | 
			
		||||
    language.set_stages(answers_dict["stages"])
 | 
			
		||||
    language.set_attribute(answers_dict["attribute"])
 | 
			
		||||
    answers = answer.Answers(name=answers_dict["name"], language=language)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user