From a0cd1b66c2c8c1fd3a3f86d3b48d6a070ab89fcd Mon Sep 17 00:00:00 2001 From: zzjc1234 <2359047351@qq.com> Date: Thu, 12 Sep 2024 16:10:44 +0800 Subject: [PATCH] chore: comment of code --- pkg/healthcheck/commit.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/healthcheck/commit.go b/pkg/healthcheck/commit.go index 36f2be6..8b1d579 100644 --- a/pkg/healthcheck/commit.go +++ b/pkg/healthcheck/commit.go @@ -10,7 +10,11 @@ import ( "github.com/go-git/go-git/v5/plumbing/object" ) -// NonAsciiMsg checks for non-ASCII characters in the commit message. +// nonAsciiMsg checks for non-ASCII characters in the commit message. +// If the message starts with "Merge pull request", it skips the non-ASCII characters check. +// Otherwise, it iterates over each character in the message and checks if it is a non-ASCII character. +// If a non-ASCII character is found, it returns an error indicating not to use non-ASCII characters in commit messages. +// Otherwise, it returns nil indicating that the commit message is valid. // It skips the non-ASCII characters check for lines starting with specific keywords like "Co-authored-by", "Reviewed-by", and "Co-committed-by". func NonAsciiMsg(root string) error { repo, err := git.PlainOpen(root)