Skip to content

Commit

Permalink
feat(checks): allow slashes in scope
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-soubeyrand authored and fallion committed Jun 21, 2023
1 parent a43e7f5 commit fd4fae8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/text/check_message_title.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (

// Fields such as category and chore should contain only word characters
categoryRegex = regexp.MustCompile(`^\w+$`)
scopeRegex = regexp.MustCompile(`^\w+(-\w+|_\w+| \w+)*$`)
scopeRegex = regexp.MustCompile(`^\w+(-\w+|_\w+|/\w+| \w+)*$`)

// Commits with breaking changes should contain text with BREAKING CHANGE: at start
bcRegex = regexp.MustCompile(`^BREAKING CHANGE: `)
Expand Down
1 change: 1 addition & 0 deletions pkg/text/check_message_title_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestCheckMessageTitleNonStrict(t *testing.T) {
quoad.Commit{Category: "test", Heading: "a heading", Body: "body is here", Breaking: true},
quoad.Commit{Category: "test", Scope: "dashed-scope", Heading: "a heading", Body: "body is here", Breaking: true},
quoad.Commit{Category: "test", Scope: "undescore_scope", Heading: "a heading", Body: "body is here", Breaking: true},
quoad.Commit{Category: "test", Scope: "slash/scope", Heading: "a heading", Body: "body is here", Breaking: true},
},
errCategoryWrongFormat: []quoad.Commit{
quoad.Commit{Category: "fix!", Breaking: true, Heading: "breaking"},
Expand Down

1 comment on commit fd4fae8

@vercel
Copy link

@vercel vercel bot commented on fd4fae8 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.