Skip to content

Commit

Permalink
chore: Ensure commit messages start with a capital letter
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Dec 29, 2024
1 parent ee0c3a5 commit 3c82138
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/cmds/lint-commit-messages/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
)

var commitRx = regexp.MustCompile(`\A([0-9a-f]{40}) (chore(?:\([\w\-]+\))?|docs|feat|fix): `)
var commitRx = regexp.MustCompile(`\A([0-9a-f]{40}) (chore(?:\([\w\-]+\))?|docs|feat|fix): [A-Z]`)

func run() error {
args := append([]string{"log", "--format=oneline"}, os.Args[1:]...)
Expand Down
12 changes: 6 additions & 6 deletions internal/cmds/lint-commit-messages/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
func TestCommitRx(t *testing.T) {
prefix := strings.Repeat("0", 40) + " "
for s, match := range map[string]bool{
"chore(deps): text": true,
"chore(deps-dev): text": true,
"chore: text": true,
"docs: text": true,
"feat: text": true,
"fix: text": true,
"chore(deps): Text": true,
"chore(deps-dev): Text": true,
"chore: Text": true,
"docs: Text": true,
"feat: Text": true,
"fix: Text": true,
"fixup!": false,
"snapshot": false,
} {
Expand Down

0 comments on commit 3c82138

Please sign in to comment.