Skip to content

Commit 0738a9b

Browse files
committed
improve PR title validation script: refine regex and add detailed format guidance
1 parent 09f31c8 commit 0738a9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/check_pr_title.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def main():
1313

1414
# Regex for [TASK] format
1515
task_pattern = re.compile(
16-
r"^\[TASK\]\s*\d+-\d+\.\s+[А-ЯЁ][а-яё]+ [А-ЯЁ][а-яё]+ [А-ЯЁ][а-яё]+\.\s+[0-9А-Яа-я\-]+\. .+$"
16+
r"^\[TASK\]\s*\d+-\d+\.\s+[А-ЯЁ][а-яё]+ [А-ЯЁ][а-яё]+ [А-ЯЁ][а-яё]+\.\s+[0-9А-Яа-я\-]+\. .+\.$"
1717
)
1818

1919
# Regex for [DEV] format
@@ -24,7 +24,12 @@ def main():
2424
print("✅ PR title is valid")
2525
sys.exit(0)
2626
else:
27+
# Print detailed guidance with templates and example
2728
print("❌ Invalid PR title format")
29+
print("\nAllowed PR title formats:")
30+
print("- [TASK] <Task Number>-<Variant number>. <Last Name> <First Name> <Middle Name>. <Group number>. <Task name>.")
31+
print(" Example: [TASK] 2-12. Иванов Иван Иванович. 2341-а234. Вычисление суммы элементов вектора.")
32+
print("- [DEV] <any text>")
2833
sys.exit(1)
2934

3035

0 commit comments

Comments
 (0)