@@ -394,25 +394,24 @@ validate_commit_message() {
394
394
add_warning 1 " Do not write single-word commits. Provide a descriptive subject"
395
395
fi
396
396
397
- # 7a. Avoid using C source filenames as the commit subject.
397
+ # 7a. Avoid using C source filenames as the commit subject
398
398
if [[ " ${COMMIT_SUBJECT_TO_PROCESS} " =~ ^[_a-zA-Z0-9]+\. [ch]$ ]]; then
399
399
add_warning 1 " Avoid mentioning C source filenames in the commit subject"
400
400
fi
401
401
402
- # 7b. Disallow parentheses in the commit subject.
402
+ # 7b. Disallow parentheses in the commit subject
403
403
if [[ ${COMMIT_SUBJECT_TO_PROCESS} =~ [\(\) ] ]]; then
404
404
add_warning 1 " Avoid using parentheses '()' in commit subjects"
405
405
fi
406
406
407
- # 7c. Disallow conventional commit format (e.g., "chore(scope):", "feat:", etc.)
407
+ # 7c. Disallow conventional commit format
408
408
# These formats waste precious characters from the 50-character limit
409
409
# Check for patterns like "type:" or "type(scope):" with optional breaking change indicator
410
410
if [[ ${COMMIT_SUBJECT} =~ ^[a-z]+\( [^\) ]+\) :[[:space:]] ]] || [[ ${COMMIT_SUBJECT} =~ ^[a-z]+! ? :[[:space:]] ]]; then
411
411
add_warning 1 " Avoid conventional commit format (e.g., 'chore(scripts):', 'feat:', 'fix:'). Write a direct, descriptive subject"
412
412
fi
413
413
414
- # 7d. Alert if the commit subject starts with "Implementation"
415
- # ------------------------------------------------------------------------------
414
+ # 7d. Alert if the commit subject starts with non-imperative words
416
415
if [[ " ${COMMIT_SUBJECT_TO_PROCESS} " =~ ^(First| My| Implementation| Implementations| Creation| Modification| Queue) ]]; then
417
416
add_warning 1 " Commit subject should use imperative mood"
418
417
fi
@@ -439,6 +438,14 @@ validate_commit_message() {
439
438
fi
440
439
fi
441
440
441
+ # 8a. For queue functions (q_*), require detailed explanation in body
442
+ # Check if subject mentions queue functions like "Implement q_size" or "Fix q_new"
443
+ if [[ " ${COMMIT_SUBJECT} " =~ q_[a-zA-Z_]+ ]]; then
444
+ if [ " ${NON_COMMENT_COUNT} " -le 1 ]; then
445
+ add_warning 1 " Queue function commits require detailed explanation in the body"
446
+ fi
447
+ fi
448
+
442
449
# 9. Do not start the subject line with whitespace
443
450
# ------------------------------------------------------------------------------
444
451
0 commit comments