Skip to content

Commit 3a48d03

Browse files
bsorrentinotomasbjerre
authored andcommitted
feat(ConventionalCommitParser.java): update regex to include slashes in scope
- Updated the regex pattern to include slashes in the scope section.
1 parent 4886878 commit 3a48d03

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/se/bjurr/gitchangelog/internal/semantic/ConventionalCommitParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@SuppressFBWarnings("REDOS")
1717
public class ConventionalCommitParser {
1818
private static final Pattern CONVENTIONAL_PATTERN =
19-
Pattern.compile("^(\\w+)(\\(([\\w\\-\\.\\,\\s:]+)\\)?)?(\\!?)[\\s?]*:(.+)");
19+
Pattern.compile("^(\\w+)(\\(([/\\w\\-\\.\\,\\s:]+)\\)?)?(\\!?)[\\s?]*:(.+)");
2020

2121
private static final Pattern FOOTER_PATTERN =
2222
Pattern.compile("^(BREAKING[ -]CHANGE|[^ ]+)(((: )|( #))(.+))");

src/test/java/se/bjurr/gitchangelog/internal/semantic/ConventionalCommitParserTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public void testThatDescriptionCanBeParsed() {
2121

2222
@Test
2323
public void testThatScopeCanBeParsed() {
24+
this.test("feat(core/node): add polish language", List.of("core/node"));
2425
this.test("feat(lang): add polish language", List.of("lang"));
2526
this.test("feat(la-ng): add polish language", List.of("la-ng"));
2627
this.test("feat(l): add polish language", List.of("l"));

0 commit comments

Comments
 (0)