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 10
10
* cppcheck-suppress nullPointer
11
11
*/
12
12
13
-
13
+ /* Change */
14
14
/* Create an empty queue */
15
15
struct list_head * q_new ()
16
16
{
Original file line number Diff line number Diff line change @@ -288,11 +288,14 @@ validate_commit_message() {
288
288
# Count non-comment, non-blank lines excluding "Change-Id:".
289
289
NON_COMMENT_COUNT=$( sed ' /^[[:space:]]*#/d;/^[[:space:]]*$/d;/^[[:space:]]*Change-Id:/d' " ${COMMIT_MSG_FILE} " | wc -l | xargs)
290
290
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
296
299
fi
297
300
298
301
# 9. Do not start the subject line with whitespace
You can’t perform that action at this time.
0 commit comments