refactor(parser/diff): rename field with default
All checks were successful
submodules sync / sync (push) Successful in 37s
build / build (push) Successful in 1m8s
build / trigger-build-image (push) Successful in 6s

This commit is contained in:
张泊明518370910136 2024-11-29 01:57:44 -05:00
parent 862693bf1f
commit a708e768ec
GPG Key ID: D47306D7062CDA9D

View File

@ -20,11 +20,11 @@ const (
) )
type Conf struct { type Conf struct {
PassComment string `default:"🥳Passed!\n"` PassComment string `default:"🥳Passed!\n"`
FailComment string `default:"🧐Failed...\n"` FailComment string `default:"🧐Failed...\n"`
PassNonAcceptedStatus bool FailOnNotAccepted bool `default:"true"`
ForceQuitOnFailed bool ForceQuitOnFailed bool `default:"false"`
Cases []struct { Cases []struct {
Outputs []struct { Outputs []struct {
Score int Score int
FileName string FileName string
@ -56,7 +56,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
result := results[i] result := results[i]
score := 0 score := 0
comment := "" comment := ""
if !conf.PassNonAcceptedStatus && if conf.FailOnNotAccepted &&
result.Status != stage.Status(envexec.StatusAccepted) { result.Status != stage.Status(envexec.StatusAccepted) {
if conf.ForceQuitOnFailed { if conf.ForceQuitOnFailed {
forceQuit = true forceQuit = true