File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1010 * cppcheck-suppress nullPointer
1111 */
1212
13-
13+ /* Change */
1414/* Create an empty queue */
1515struct list_head * q_new ()
1616{
Original file line number Diff line number Diff line change @@ -288,11 +288,14 @@ validate_commit_message() {
288288 # Count non-comment, non-blank lines excluding "Change-Id:".
289289 NON_COMMENT_COUNT=$( sed ' /^[[:space:]]*#/d;/^[[:space:]]*$/d;/^[[:space:]]*Change-Id:/d' " ${COMMIT_MSG_FILE} " | wc -l | xargs)
290290
291- # If the subject is oversimplified for a queue function OR queue.c is modified,
292- # and there is only one meaningful line, issue a warning.
293- if { [[ " ${COMMIT_SUBJECT_TO_PROCESS} " =~ ^(Implement| Finish| Complete)[[:space:]]+q_[[:alnum:]_]+\( ? \) ? $ ]] || \
294- git diff --cached --name-only | grep -Eq ' (^|/)queue\.c$' ; } && [ " ${NON_COMMENT_COUNT} " -le 1 ]; then
295- add_warning 1 " Commit message oversimplified. Use the commit message body to explain what and why."
291+ # If queue.c is modified and the commit message is oversimplified, forbid generic subjects.
292+ if git diff --cached --name-only | grep -Eq ' (^|/)queue\.c$' ; then
293+ if [ " ${NON_COMMENT_COUNT} " -le 1 ]; then
294+ add_warning 1 " Commit message oversimplified. Use the commit message body to explain what and why."
295+ fi
296+ if [[ " ${COMMIT_SUBJECT_TO_PROCESS} " =~ ^(Complete| Finish| Done)[[:space:]]+ ]]; then
297+ add_warning 1 " Avoid using generic subjects starting with 'Complete', 'Finish', or 'Done'"
298+ fi
296299 fi
297300
298301 # 9. Do not start the subject line with whitespace
You can’t perform that action at this time.
0 commit comments