From e34cba9b17a9a9d15070386abb6b7fea81764469 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Sat, 21 Jun 2025 13:13:42 -0400 Subject: [PATCH] chore(parser/diff): remove newline in pass/fail comment --- internal/parser/diff/meta.go | 4 ++-- internal/parser/diff/parser.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/parser/diff/meta.go b/internal/parser/diff/meta.go index cd7ea42..2891d20 100644 --- a/internal/parser/diff/meta.go +++ b/internal/parser/diff/meta.go @@ -8,8 +8,8 @@ import "github.com/joint-online-judge/JOJ3/internal/stage" var name = "diff" type Conf struct { - PassComment string `default:"🥳Passed!\n"` - FailComment string `default:"🧐Failed...\n"` + PassComment string `default:"🥳Passed!"` + FailComment string `default:"🧐Failed..."` FailOnNotAccepted bool `default:"true"` ForceQuitOnFailed bool `default:"false"` Cases []struct { diff --git a/internal/parser/diff/parser.go b/internal/parser/diff/parser.go index be08ff5..78fc468 100644 --- a/internal/parser/diff/parser.go +++ b/internal/parser/diff/parser.go @@ -31,7 +31,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) ( if conf.ForceQuitOnFailed { forceQuit = true } - comment += conf.FailComment + comment += conf.FailComment + "\n" comment += "Executor status not `Accepted`\n" } else { for _, output := range caseConf.Outputs { @@ -58,12 +58,12 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) ( // If no difference, assign score if isSame { score += output.Score - comment += conf.PassComment + comment += conf.PassComment + "\n" } else { if output.ForceQuitOnDiff || conf.ForceQuitOnFailed { forceQuit = true } - comment += conf.FailComment + comment += conf.FailComment + "\n" comment += fmt.Sprintf("Difference found in `%s`\n", output.FileName) if !output.AlwaysHide {