From c218c9306926547beef90181fc099a88224cb34a Mon Sep 17 00:00:00 2001 From: Boming Zhang <bomingzh@sjtu.edu.cn> Date: Tue, 15 Oct 2024 03:43:19 -0400 Subject: [PATCH] feat(parser/diff): option to force quit on diff --- internal/parser/diff/parser.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/parser/diff/parser.go b/internal/parser/diff/parser.go index bd31ace..57f6473 100644 --- a/internal/parser/diff/parser.go +++ b/internal/parser/diff/parser.go @@ -24,11 +24,12 @@ type Conf struct { FailComment string `default:"🧐Failed...\n"` Cases []struct { Outputs []struct { - Score int - FileName string - AnswerPath string - CompareSpace bool - AlwaysHide bool + Score int + FileName string + AnswerPath string + CompareSpace bool + AlwaysHide bool + ForceQuitOnDiff bool } } } @@ -67,6 +68,9 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) ( score += output.Score comment += conf.PassComment } else { + if output.ForceQuitOnDiff { + forceQuit = true + } comment += conf.FailComment comment += fmt.Sprintf("Difference found in `%s`.\n", output.FileName)