diff --git a/git_hooks/common.py b/git_hooks/common.py index 9097e79..03076c9 100644 --- a/git_hooks/common.py +++ b/git_hooks/common.py @@ -34,17 +34,18 @@ teams: list[str] = [ "T", "L2", - "DAE" + "DAE", + "PDEV" ] linear_ref: str = ( "(?:" f"{'|'.join(t for t in teams)}" "|" - r"[A-Z]{3}" + r"[A-Z]{1,4}" "|" f"{'|'.join(t.lower() for t in teams)}" "|" - r"[a-z]{3}" + r"[a-z]{1,4}" ")-[0-9]{1,5}" ) valid_commit_regex: str = ( diff --git a/git_hooks/test_commit_msg.py b/git_hooks/test_commit_msg.py index 27c1a93..17946f9 100644 --- a/git_hooks/test_commit_msg.py +++ b/git_hooks/test_commit_msg.py @@ -9,7 +9,7 @@ [ ("T-5482/feat: Amazing new feature", 0), ("feat: Amazing new feature", 1), - ("X-5482/feat: Amazing new feature", 1), + ("X-5482/feat: Amazing new feature", 0), ("X-5482/Amazing new feature", 1), ], ) diff --git a/git_hooks/test_common.py b/git_hooks/test_common.py index 9bdf8cb..8e4ce3f 100644 --- a/git_hooks/test_common.py +++ b/git_hooks/test_common.py @@ -27,6 +27,7 @@ def test_commit_type_regex(commit_type: str): "xyz-1234", "T-1", "L2-99999", + "PDEV-1234", ], ) def test_linear_ref(issue: str): @@ -42,6 +43,7 @@ def test_linear_ref(issue: str): "xyz-1234/docs: ", "T-1/style: ", "L2-99999/test: ", + "PDEV-1234/feat: ", ], ) def test_valid_commit_regex(commit: str): @@ -91,6 +93,7 @@ def test_commit_msg_title_regex(commit_msg: str): "xyz-1234/docs: add something", "T-1/style add something", "L2-99999/test: add something", + "PDEV-1234/feat: add something", ], ) def test_commit_msg_issue_regex(commit_msg: str): @@ -108,6 +111,7 @@ def test_commit_msg_issue_regex(commit_msg: str): "xyz-1234", "T-1", "L2-99999", + "PDEV-1234", ], ) def test_issue_regex(issue: str):