dev #10
|
@ -2,8 +2,8 @@ from typing import List
|
|||
|
||||
from joj3_config_generator.lib.repo import getHealthcheckConfig
|
||||
from joj3_config_generator.lib.task import (
|
||||
fix_comment,
|
||||
fix_diff,
|
||||
fix_dummy,
|
||||
fix_keyword,
|
||||
fix_result_detail,
|
||||
get_conf_stage,
|
||||
|
@ -36,7 +36,7 @@ def convert(repo_conf: repo.Config, task_conf: task.Config) -> result.Config:
|
|||
executor_with_config, cached = get_executorWithConfig(task_stage, cached)
|
||||
conf_stage = get_conf_stage(task_stage, executor_with_config)
|
||||
jon-lee marked this conversation as resolved
Outdated
|
||||
conf_stage = fix_result_detail(task_stage, conf_stage)
|
||||
conf_stage = fix_comment(task_stage, conf_stage)
|
||||
conf_stage = fix_dummy(task_stage, conf_stage)
|
||||
conf_stage = fix_keyword(task_stage, conf_stage)
|
||||
conf_stage = fix_diff(task_stage, conf_stage)
|
||||
result_conf.stage.stages.append(conf_stage)
|
||||
|
|
|
@ -107,7 +107,6 @@ def get_executorWithConfig(
|
|||
return (executor_with_config, cached)
|
||||
|
||||
|
||||
# FIXME: fix severity and "keywords"
|
||||
def fix_keyword(
|
||||
task_stage: task.Stage, conf_stage: result.StageDetail
|
||||
) -> result.StageDetail:
|
||||
|
@ -172,21 +171,27 @@ def fix_result_detail(task_stage: TaskStage, conf_stage: ResultStage) -> ResultS
|
|||
return conf_stage
|
||||
|
||||
|
||||
def fix_comment(task_stage: TaskStage, conf_stage: ResultStage) -> ResultStage:
|
||||
comment_parser = [
|
||||
def fix_dummy(
|
||||
task_stage: task.Stage, conf_stage: result.StageDetail
|
||||
) -> result.StageDetail:
|
||||
dummy_parser = [
|
||||
"dummy",
|
||||
"result-status",
|
||||
"cpplint",
|
||||
] # FIXME: determine where cpplint should be
|
||||
]
|
||||
if task_stage.parsers is not None:
|
||||
for parser in task_stage.parsers:
|
||||
if parser in comment_parser:
|
||||
comment_parser_ = next(
|
||||
p for p in conf_stage.parsers if p.name == parser
|
||||
)
|
||||
if getattr(task_stage, parser.replace("-", "_"), None) is not None:
|
||||
comment_parser_.with_.update(
|
||||
getattr(task_stage, parser.replace("-", "_"))
|
||||
if parser in dummy_parser:
|
||||
dummy_parser_ = next(p for p in conf_stage.parsers if p.name == parser)
|
||||
if (
|
||||
getattr(task_stage, parser.replace("-", "_"), None) is not None
|
||||
) and (task_stage.result_status is not None):
|
||||
dummy_parser_.with_.update(
|
||||
{
|
||||
"score": task_stage.result_status.score,
|
||||
"comment": task_stage.result_status.comment,
|
||||
"forceQuitOnNotAccepted": task_stage.result_status.forcequit,
|
||||
}
|
||||
)
|
||||
else:
|
||||
continue
|
||||
|
|
|
@ -14,6 +14,8 @@ class ParserResultDetail(BaseModel):
|
|||
|
||||
class ParserDummy(BaseModel):
|
||||
comment: Optional[str] = ""
|
||||
score: Optional[int] = 0
|
||||
forcequit: Optional[bool] = True
|
||||
|
||||
|
||||
class ParserKeyword(BaseModel):
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"/<function",
|
||||
"get_temp_directory",
|
||||
"at",
|
||||
"0x7efe709e4180>/repo-health-checker",
|
||||
"0x7fa86726c180>/repo-health-checker",
|
||||
"-root=.",
|
||||
"-repoSize=50.5",
|
||||
"-meta=main.py",
|
||||
|
@ -70,8 +70,8 @@
|
|||
"cpuRateLimit": 0,
|
||||
"cpuSetLimit": "",
|
||||
"copyIn": {
|
||||
"//tmp/repo-checker-d89rnuip/repo-health-checker": {
|
||||
"src": "//tmp/repo-checker-tk3cqa0k/repo-health-checker",
|
||||
"//tmp/repo-checker-va9ba49a/repo-health-checker": {
|
||||
"src": "//tmp/repo-checker-e82nkuo4/repo-health-checker",
|
||||
"content": null,
|
||||
"fileId": null,
|
||||
"name": null,
|
||||
|
@ -246,13 +246,17 @@
|
|||
{
|
||||
"name": "dummy",
|
||||
"with": {
|
||||
"comment": "\n\n### Details\n"
|
||||
"score": 1,
|
||||
"comment": "Congratulations! Your code compiled successfully.",
|
||||
"forceQuitOnNotAccepted": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "result-status",
|
||||
"with": {
|
||||
"comment": "Congratulations! Your code compiled successfully."
|
||||
"score": 1,
|
||||
"comment": "Congratulations! Your code compiled successfully.",
|
||||
"forceQuitOnNotAccepted": false
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -367,7 +371,9 @@
|
|||
{
|
||||
"name": "dummy",
|
||||
"with": {
|
||||
"comment": ""
|
||||
"score": 10000,
|
||||
"comment": "Manuel Charlemagne",
|
||||
"forceQuitOnNotAccepted": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -504,7 +510,9 @@
|
|||
{
|
||||
"name": "dummy",
|
||||
"with": {
|
||||
"comment": "\n\n### Details\n"
|
||||
"score": 0,
|
||||
"comment": "",
|
||||
"forceQuitOnNotAccepted": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -631,7 +639,9 @@
|
|||
{
|
||||
"name": "dummy",
|
||||
"with": {
|
||||
"comment": "\n\n### Details\n"
|
||||
"score": 0,
|
||||
"comment": "",
|
||||
"forceQuitOnNotAccepted": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -727,16 +737,9 @@
|
|||
{
|
||||
"name": "cpplint",
|
||||
"with": {
|
||||
"keyword": [
|
||||
"runtime",
|
||||
"readability",
|
||||
"build"
|
||||
],
|
||||
"weight": [
|
||||
10,
|
||||
20,
|
||||
15
|
||||
],
|
||||
"score": 0,
|
||||
"comment": "",
|
||||
"forceQuitOnNotAccepted": true,
|
||||
"matches": [
|
||||
{
|
||||
"keywords": [
|
||||
|
@ -762,7 +765,9 @@
|
|||
{
|
||||
"name": "dummy",
|
||||
"with": {
|
||||
"comment": "\n\n### Details\n"
|
||||
"score": 0,
|
||||
"comment": "",
|
||||
"forceQuitOnNotAccepted": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1013,7 +1018,9 @@
|
|||
{
|
||||
"name": "dummy",
|
||||
"with": {
|
||||
"comment": "\n\n### Details\n"
|
||||
"score": 0,
|
||||
"comment": "",
|
||||
"forceQuitOnNotAccepted": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1264,7 +1271,9 @@
|
|||
{
|
||||
"name": "dummy",
|
||||
"with": {
|
||||
"comment": "\n\n### Details\n"
|
||||
"score": 0,
|
||||
"comment": "",
|
||||
"forceQuitOnNotAccepted": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -15,6 +15,8 @@ limit.stderr = 128
|
|||
# compile parsers
|
||||
parsers = [ "result-detail", "dummy", "result-status" ]
|
||||
result-status.comment = "Congratulations! Your code compiled successfully."
|
||||
result-status.score = 1
|
||||
result-status.forcequit = false
|
||||
dummy.comment = "\n\n### Details\n"
|
||||
result-detail.exitstatus = true
|
||||
result-detail.stderr = true
|
||||
|
@ -33,6 +35,9 @@ result-detail.exitstatus = true
|
|||
result-detail.stderr = true
|
||||
result-detail.time = false
|
||||
result-detail.mem = false
|
||||
result-status.comment = "Manuel Charlemagne"
|
||||
result-status.score = 10000
|
||||
result-status.forcequit = true
|
||||
|
||||
[[stages]]
|
||||
name = "Clang-tidy checks"
|
||||
|
|
Loading…
Reference in New Issue
Block a user
where is it used?
this should be storing all the files that are about to be copy in or out
It is as the input and output for the following functions about parsers
so this feature is not implemented?
it is
this is a loop, so this
cached
will be updated in every round of stageThe return value is unnecessary.
I have a lazing coding style here, everything has get imported would get exported, so should maintain this until the end of the loop. Everything is exported in previous stage would be imported in the next stage.
set
try it yourself
I see why
resolved.