fix: use task.config.path
All checks were successful
build / build (push) Successful in 2m32s
build / build (pull_request) Successful in 2m30s

This commit is contained in:
李衍志523370910113 2025-03-04 13:34:25 +08:00
parent 9c20c6b377
commit 275f9f981c
3 changed files with 43 additions and 26 deletions

View File

@ -1,6 +1,8 @@
import re
import shlex
from typing import List, Set
from typing import Callable, Dict, List, Set, Tuple
from pydantic import BaseModel
from joj3_config_generator.models import result, task
from joj3_config_generator.models.const import JOJ3_CONFIG_ROOT
@ -48,6 +50,21 @@ def get_conf_stage(
return conf_stage
# def get_processed_dict(task_stage: task.Stagew) -> Dict[str, Tuple[Callable[[task.Stage, BaseModel], None], BaseModel]]:
# processed_dict: Dict[str, Tuple[Callable[[task.Stage, task.StageDetail], None], BaseModel]] = {
# "clang-tidy": (fix_keyword, result.clang-tidy),
# "keyword": (fix_keyword, result.KeywordConfig),
# "cppcheck": (fix_keyword, result.KeywordConfig),
# "cpplint": (fix_keyword, result.KeywordConfig),
# "result-detail": (fix_result_detail, result.ResultDetailConfig),
# "dummy": (fix_dummy, result.DummyConfig),
# "result-status": (fix_dummy, result.DummyConfig),
# "file": (fix_file, result.FileConfig),
# "diff": (fix_diff, result.DiffConfig),
# }
# return processed_dict
def get_executor_with(task_stage: task.Stage, cached: Set[str]) -> result.ExecutorWith:
file_import = task_stage.files.import_
copy_in_files = [file for file in file_import if file not in cached]
@ -183,7 +200,7 @@ def fix_diff(
stage_cases.append(
result.OptionalCmd(
stdin=result.LocalFile(
src=str(JOJ3_CONFIG_ROOT / task_conf.task.type_ / stdin),
src=str(JOJ3_CONFIG_ROOT / task_conf.path.parent / stdin),
),
args=shlex.split(command) if command else None,
cpu_limit=cpu_limit,
@ -207,7 +224,7 @@ def fix_diff(
score=diff_output.score,
file_name="stdout",
answer_path=str(
JOJ3_CONFIG_ROOT / task_conf.task.type_ / stdout
JOJ3_CONFIG_ROOT / task_conf.path.parent / stdout
),
force_quit_on_diff=diff_output.force_quit,
always_hide=diff_output.hide,

View File

@ -223,10 +223,10 @@
},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -323,10 +323,10 @@
},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -445,10 +445,10 @@
"copyIn": {},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -588,10 +588,10 @@
"copyIn": {},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -685,10 +685,10 @@
"copyIn": {},
"copyInCached": {
"h7/build/compile_commands.json": "h7/build/compile_commands.json",
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2",
"h7/build/ex2-asan": "h7/build/ex2-asan",
"h7/build/ex2-ubsan": "h7/build/ex2-ubsan",
"h7/build/ex2-asan": "h7/build/ex2-asan"
"h7/build/ex2-msan": "h7/build/ex2-msan",
"h7/build/ex2": "h7/build/ex2"
},
"copyInDir": ".",
"copyOut": [
@ -706,7 +706,7 @@
"cases": [
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case0.in"
"src": "/home/tt/.config/joj/case0.in"
},
"cpuLimit": 500000000,
"clockLimit": 1000000000,
@ -715,7 +715,7 @@
},
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case1.in"
"src": "/home/tt/.config/joj/case1.in"
},
"cpuLimit": 1234567890,
"clockLimit": 2469135780,
@ -736,7 +736,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case0.out",
"answerPath": "/home/tt/.config/joj/case0.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false
@ -748,7 +748,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case1.out",
"answerPath": "/home/tt/.config/joj/case1.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false

View File

@ -64,7 +64,7 @@
"cases": [
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case0.in"
"src": "/home/tt/.config/joj/case0.in"
},
"cpuLimit": 1000000000,
"clockLimit": 2000000000,
@ -73,7 +73,7 @@
},
{
"stdin": {
"src": "/home/tt/.config/joj/homework/h7/e2/case1.in"
"src": "/home/tt/.config/joj/case1.in"
},
"cpuLimit": 2000000000,
"clockLimit": 4000000000,
@ -94,7 +94,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case0.out",
"answerPath": "/home/tt/.config/joj/case0.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false
@ -106,7 +106,7 @@
{
"score": 5,
"fileName": "stdout",
"answerPath": "/home/tt/.config/joj/homework/h7/e2/case1.out",
"answerPath": "/home/tt/.config/joj/case1.out",
"forceQuitOnDiff": false,
"alwaysHide": false,
"compareSpace": false