Skip to content

Commit

Permalink
T-18322/chore: Adding DEL to git-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
shelmigtwo committed Jul 17, 2024
1 parent 8d4efbe commit 37b5bc5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git_hooks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
commit_type_regex = (
"(?:build|chore|ci|docs|feat|fix|hotfix|perf|refactor|revert|style|test)"
)
linear_ref = "(?:t|T|kna|KNA|cet|CET|nor|NOR|l2|L2)-[0-9]{1,5}"
linear_ref = "(?:t|T|kna|KNA|cet|CET|nor|NOR|l2|L2|del|DEL)-[0-9]{1,5}"
valid_commit_regex = (
f"^{linear_ref}/{commit_type_regex}!?: |Merge .+|Revert .+|Bump version .+"
)
Expand Down
13 changes: 12 additions & 1 deletion git_hooks/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_commit_type_regex(commit_type: str):
"CET-1234",
"NOR-1234",
"L2-1234",
"DEL-14",
],
)
def test_linear_ref(issue: str):
Expand All @@ -41,6 +42,7 @@ def test_linear_ref(issue: str):
"CET-1234/docs: ",
"NOR-1234/style: ",
"L2-1234/test: ",
"DEL-14/refactor: "
],
)
def test_valid_commit_regex(commit: str):
Expand All @@ -55,6 +57,7 @@ def test_valid_commit_regex(commit: str):
"feat/CET-1234-fix-something",
"bharat/L2-1234-add-something",
"brtkwr/cet-281-fix-company-search-gb-bucket-permission",
"shelmig/del-13-update-credentials",
],
)
def test_branch_regex(branch: str):
Expand Down Expand Up @@ -89,6 +92,7 @@ def test_commit_msg_title_regex(commit_msg: str):
"NOR-1234/docs: add something",
"L2-1234/style add something",
"T-1234/test: add something",
"DEL-1234/test: add something",
],
)
def test_commit_msg_issue_regex(commit_msg: str):
Expand All @@ -105,6 +109,7 @@ def test_commit_msg_issue_regex(commit_msg: str):
"CET-1234",
"NOR-1234",
"L2-1234",
"DEL-1234",
],
)
def test_issue_regex(issue: str):
Expand All @@ -114,10 +119,16 @@ def test_issue_regex(issue: str):
@pytest.mark.parametrize(
"prefix",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"hotfix",
"docs",
"perf",
"refactor",
"revert",
"style",
"test",
],
Expand Down

0 comments on commit 37b5bc5

Please sign in to comment.