Skip to content

Commit 52202da

Browse files
authored
style: improve consistency and clarity of commit messages (#19)
- Add `go.mod` to the excluded files when diffing - Lowercase the first character of the first word of the commit message and remove the last period fix #17
1 parent c3c521f commit 52202da

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

cmd/commit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ var commitCmd = &cobra.Command{
103103
return err
104104
}
105105

106+
// lowercase the first character of first word of the commit message and remove last period
107+
summarizeTitle = strings.TrimRight(strings.ToLower(string(summarizeTitle[0]))+summarizeTitle[1:], ".")
108+
106109
// support conventional commits
107110
out, err = util.GetTemplate(
108111
prompt.ConventionalCommitTemplate,

git/git.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var excludeFromDiff = []string{
1717
// yarn.lock, Cargo.lock, Gemfile.lock, Pipfile.lock, etc.
1818
"*.lock",
1919
"go.sum",
20+
"go.mod",
2021
}
2122

2223
type Command struct{}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/appleboy/CodeGPT
33
go 1.20
44

55
require (
6-
github.com/appleboy/com v0.1.6
6+
github.com/appleboy/com v0.1.7
77
github.com/fatih/color v1.14.1
88
github.com/sashabaranov/go-openai v1.4.1
99
github.com/spf13/cobra v1.6.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
3838
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
3939
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
4040
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
41-
github.com/appleboy/com v0.1.6 h1:vP9ryTIbSFaXSrZcFTU7RRcgPbrpGJ0Oy5wpgEkQ2m8=
42-
github.com/appleboy/com v0.1.6/go.mod h1:jnufjIC3opMlReyPPPye+8JqNvUzLm25o7h6SOy8nv0=
41+
github.com/appleboy/com v0.1.7 h1:4lYTFNoMAAXGGIC8lDxVg/NY+1aXbYqfAWN05cZhd0M=
42+
github.com/appleboy/com v0.1.7/go.mod h1:JUK+oH0SXCLRH57pDMJx6VWVsm8CPdajalmRSWwamBE=
4343
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
4444
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
4545
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=

0 commit comments

Comments
 (0)