From b147cf00a98d1c520245447532975f6b6cdfe580 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Mon, 2 Jun 2025 23:08:13 -0400 Subject: [PATCH] fix(cmd/joj3): return empty conventional commit on parsing error --- cmd/joj3/conf/conf.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/joj3/conf/conf.go b/cmd/joj3/conf/conf.go index 10c373b..c9b47fd 100644 --- a/cmd/joj3/conf/conf.go +++ b/cmd/joj3/conf/conf.go @@ -40,7 +40,7 @@ func parseConventionalCommit(commit string) (*ConventionalCommit, error) { re := regexp.MustCompile(`(?s)^(\w+)(\(([^)]+)\))?!?: (.+?(\[([^\]]+)\])?)(\n\n(.+?))?(\n\n(.+))?$`) matches := re.FindStringSubmatch(strings.TrimSpace(commit)) if matches == nil { - return nil, fmt.Errorf("invalid conventional commit format") + return &ConventionalCommit{}, fmt.Errorf("invalid conventional commit format") } cc := &ConventionalCommit{ Type: matches[1],