feat(parser/resultdetail): show files
This commit is contained in:
parent
8bf63594f0
commit
7648dde9da
|
@ -13,6 +13,7 @@ type Conf struct {
|
||||||
ShowTime bool `default:"true"`
|
ShowTime bool `default:"true"`
|
||||||
ShowMemory bool `default:"true"`
|
ShowMemory bool `default:"true"`
|
||||||
ShowRunTime bool `default:"false"`
|
ShowRunTime bool `default:"false"`
|
||||||
|
ShowFiles []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResultDetail struct{}
|
type ResultDetail struct{}
|
||||||
|
@ -44,6 +45,15 @@ func (*ResultDetail) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
if conf.ShowRunTime {
|
if conf.ShowRunTime {
|
||||||
comment += fmt.Sprintf("RunTime: %d\n", result.RunTime)
|
comment += fmt.Sprintf("RunTime: %d\n", result.RunTime)
|
||||||
}
|
}
|
||||||
|
for _, file := range conf.ShowFiles {
|
||||||
|
content, ok := result.Files[file]
|
||||||
|
comment += fmt.Sprintf("File: `%s`.\n", file)
|
||||||
|
if ok {
|
||||||
|
comment += fmt.Sprintf("```%s```\n", content)
|
||||||
|
} else {
|
||||||
|
comment += "Not found.\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
res = append(res, stage.ParserResult{
|
res = append(res, stage.ParserResult{
|
||||||
Score: conf.Score,
|
Score: conf.Score,
|
||||||
Comment: comment,
|
Comment: comment,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user