From: Yuanhan Liu Date: Wed, 11 May 2016 04:09:01 +0000 (-0700) Subject: scripts: highlight bad patterns in commit check X-Git-Tag: spdx-start~6857 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e5ca6e91cc39bac0e610efcb6e67a61f252d288e;p=dpdk.git scripts: highlight bad patterns in commit check I got a report like following: Wrong headline lowercase: xxx: move vhost device ctx to cuse It takes a bit while (by checking the code) that it's "ctx" triggers the warning. It could be spotted very quickly if "tx" is highlighted. This patch adds such support. Signed-off-by: Yuanhan Liu --- diff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh index b7ea1beb9a..153f378ee7 100755 --- a/scripts/check-git-log.sh +++ b/scripts/check-git-log.sh @@ -55,7 +55,7 @@ tags=$(git log --format='%b' $range | grep -i -e 'by *:' -e 'fix.*:') fixes=$(git log --format='%h %s' $range | grep -i ': *fix' | cut -d' ' -f1) # check headline format (spacing, no punctuation, no code) -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e ' ' \ -e '^ ' \ -e ' $' \ @@ -69,7 +69,7 @@ bad=$(echo "$headlines" | grep \ [ -z "$bad" ] || printf "Wrong headline format:\n$bad\n" # check headline label for common typos -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e '^example[:/]' \ -e '^apps/' \ -e '^testpmd' \ @@ -79,14 +79,14 @@ bad=$(echo "$headlines" | grep \ [ -z "$bad" ] || printf "Wrong headline label:\n$bad\n" # check headline lowercase for first words -bad=$(echo "$headlines" | grep \ +bad=$(echo "$headlines" | grep --color=always \ -e '^.*[A-Z].*:' \ -e ': *[A-Z]' \ | sed 's,^,\t,') [ -z "$bad" ] || printf "Wrong headline uppercase:\n$bad\n" # check headline uppercase (Rx/Tx, VF, L2, MAC, Linux, ARM...) -bad=$(echo "$headlines" | grep -E \ +bad=$(echo "$headlines" | grep -E --color=always \ -e '\<(rx|tx|RX|TX)\>' \ -e '\<[pv]f\>' \ -e '\' \