From 8abef27c6f5ef5457810a5a373faf03b5f4916d7 Mon Sep 17 00:00:00 2001 From: jakerivett Date: Tue, 10 Mar 2026 11:29:59 +0000 Subject: [PATCH 1/3] feat: add PDEV team prefix to linear ref validation Adds PDEV to the list of recognised Linear ticket prefixes so that commits and branches using the PDEV-* format pass the pre-commit hook. Co-Authored-By: Claude Sonnet 4.6 --- git_hooks/common.py | 3 ++- git_hooks/test_common.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/git_hooks/common.py b/git_hooks/common.py index 9097e79..d7cfead 100644 --- a/git_hooks/common.py +++ b/git_hooks/common.py @@ -34,7 +34,8 @@ teams: list[str] = [ "T", "L2", - "DAE" + "DAE", + "PDEV" ] linear_ref: str = ( "(?:" 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): From f8fb109fec5ad2ecbf7d306e636d7a4f641a3d95 Mon Sep 17 00:00:00 2001 From: jakerivett Date: Tue, 10 Mar 2026 11:33:56 +0000 Subject: [PATCH 2/3] fix: relax linear ref prefix to allow 1-4 letters Co-Authored-By: Claude Sonnet 4.6 --- git_hooks/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git_hooks/common.py b/git_hooks/common.py index d7cfead..03076c9 100644 --- a/git_hooks/common.py +++ b/git_hooks/common.py @@ -41,11 +41,11 @@ "(?:" 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 = ( From 08b2a94a7bfb3564e3baa01b0b2278500c6fd249 Mon Sep 17 00:00:00 2001 From: jakerivett Date: Tue, 10 Mar 2026 11:42:31 +0000 Subject: [PATCH 3/3] test: update X-prefix test to reflect relaxed 1-4 letter rule Co-Authored-By: Claude Sonnet 4.6 --- git_hooks/test_commit_msg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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), ], )