From 64ae632003d75497d05f6380b3d10b870f39976e Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 2 Oct 2024 19:24:30 -0400 Subject: [PATCH] feat: list group keywords --- cmd/joj3/conf.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/joj3/conf.go b/cmd/joj3/conf.go index a1da8e2..8f54337 100644 --- a/cmd/joj3/conf.go +++ b/cmd/joj3/conf.go @@ -129,9 +129,13 @@ func parseMsg(confRoot, confName, msg string) (conf Conf, group string, err erro if err != nil { return } - if strings.Contains( - strings.ToLower(conventionalCommit.Description), "joj") { - group = "joj" + groupKeywords := []string{"joj"} + for _, groupKeyword := range groupKeywords { + if strings.Contains( + strings.ToLower(conventionalCommit.Description), groupKeyword) { + group = groupKeyword + break + } } slog.Debug("conf loaded", "conf", conf) return