dev #10

Merged
李衍志523370910113 merged 238 commits from dev into master 2025-03-05 16:20:39 +08:00
2 changed files with 27 additions and 15 deletions
Showing only changes of commit b8bd3feccb - Show all commits

View File

@ -164,15 +164,17 @@ class DiffOutputConfig(BaseModel):
score: Optional[int] = None
file_name: str = Field("", alias="fileName")
answer_path: str = Field("", alias="answerPath")
force_quit_on_diff: Optional[bool] = Field(False, alias="forceQuitOnDiff")
always_hide: Optional[bool] = Field(False, alias="alwaysHide")
compare_space: Optional[bool] = Field(False, alias="compareSpace")
force_quit_on_diff: Optional[bool] = Field(
False, serialization_alias="forceQuitOnDiff"
)
always_hide: Optional[bool] = Field(False, serialization_alias="alwaysHide")
compare_space: Optional[bool] = Field(False, serialization_alias="compareSpace")
jon-lee marked this conversation as resolved Outdated

Are these Optional necessary?

Are these `Optional` necessary?
class ResultDetailConfig(BaseModel):
score: int = 0
comment: str = ""
show_files: List[str] = Field([], alias="showFiles")
show_exit_status: Optional[bool] = Field(True, alias="showExitStatus")
show_runtime: Optional[bool] = Field(True, alias="showRuntime")
show_memory: Optional[bool] = Field(False, alias="showMemory")
show_files: List[str] = Field([], serialization_alias="showFiles")
show_exit_status: Optional[bool] = Field(True, serialization_alias="showExitStatus")
jon-lee marked this conversation as resolved

also these Optional?

also these `Optional`?

I guess some of the field have default within JOJ3, so I choose optional just to reduce the length of json previously

I guess some of the field have default within JOJ3, so I choose optional just to reduce the length of json previously

better put all defaults here then we only need to check the code here

better put all defaults here then we only need to check the code here

indeed.

indeed.
show_runtime: Optional[bool] = Field(True, serialization_alias="showRuntime")
show_memory: Optional[bool] = Field(False, serialization_alias="showMemory")

View File

@ -130,15 +130,25 @@ def fix_result_detail(
if task_stage.result_detail.stderr:
show_files.append("stderr")
result_detail_parser.with_.update(
{
"score": 0,
"comment": "",
"showFiles": show_files,
"showExitStatus": task_stage.result_detail.exitstatus,
"showRuntime": task_stage.result_detail.time,
"showMemory": task_stage.result_detail.mem,
}
result.ResultDetailConfig(
score=0,
comment="",
show_files=show_files,
show_exit_status=task_stage.result_detail.exitstatus,
show_runtime=task_stage.result_detail.time,
show_memory=task_stage.result_detail.mem,
).model_dump()
jon-lee marked this conversation as resolved Outdated

When will it be None?

When will it be None?
)
# result_detail_parser.with_.update(
# {
# "score": 0,
# "comment": "",
# "showFiles": show_files,
# "showExitStatus": task_stage.result_detail.exitstatus,
# "showRuntime": task_stage.result_detail.time,
# "showMemory": task_stage.result_detail.mem,
# }
# )
return conf_stage