Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,9 @@ In addition, this project expects contributors to follow these additional rules:
* Avoid using parentheses in commit subjects.
Excessive use of parentheses "()" can clutter the subject line,
making it harder to quickly grasp the essential message.
* Avoid conventional commit format (e.g., "chore(scripts):", "feat:", "fix:").
These formats waste precious characters from the 50-character limit.
Write a direct, descriptive subject instead.

Some conventions are automatically enforced by the [githooks](https://git-scm.com/docs/githooks).

Expand Down
11 changes: 9 additions & 2 deletions scripts/commit-msg.hook
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,20 @@ validate_commit_message() {
add_warning 1 "Avoid using parentheses '()' in commit subjects"
fi

# 7c. Alert if the commit subject starts with "Implementation"
# 7c. Disallow conventional commit format (e.g., "chore(scope):", "feat:", etc.)
# These formats waste precious characters from the 50-character limit
# Check for patterns like "type:" or "type(scope):" with optional breaking change indicator
if [[ ${COMMIT_SUBJECT} =~ ^[a-z]+\([^\)]+\):[[:space:]] ]] || [[ ${COMMIT_SUBJECT} =~ ^[a-z]+!?:[[:space:]] ]]; then
add_warning 1 "Avoid conventional commit format (e.g., 'chore(scripts):', 'feat:', 'fix:'). Write a direct, descriptive subject"
fi

# 7d. Alert if the commit subject starts with "Implementation"
# ------------------------------------------------------------------------------
if [[ "${COMMIT_SUBJECT_TO_PROCESS}" =~ ^(First|My|Implementation|Implementations|Creation|Modification|Queue) ]]; then
add_warning 1 "Commit subject should use imperative mood"
fi

# 7d. Alert if the commit subject uses the pattern "Implement of ..."
# 7e. Alert if the commit subject uses the pattern "Implement of ..."
if [[ "${COMMIT_SUBJECT_TO_PROCESS}" =~ ^(Implement|Realize|Update|Finish|Code)[[:space:]]+of[[:space:]]+ ]]; then
add_warning 1 "Avoid using 'of' immediately after the verb"
fi
Expand Down