devtools: fix letter case check in commit title

Message ID 20211018095558.354074-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: fix letter case check in commit title |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-spell-check-testing warning Testing issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Thomas Monjalon Oct. 18, 2021, 9:55 a.m. UTC
  The prefix (before the colon) of the title is lowercase.
The check of uppercase/lowercase in the commit title
was supposed to apply after the colon,
but some greps were not limited to the exact word.
So in the case of "test/dma: add basic dmadev instance tests",
the lowercase word "dmadev" was wrongly suggested to be uppercase.

The words of the dictionary must be filtered as whole word
with the grep option -w.

Fixes: d448efa259e9 ("devtools: export dictionary for commit title check")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 devtools/check-git-log.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon Oct. 22, 2021, 6:04 p.m. UTC | #1
18/10/2021 11:55, Thomas Monjalon:
> The prefix (before the colon) of the title is lowercase.
> The check of uppercase/lowercase in the commit title
> was supposed to apply after the colon,
> but some greps were not limited to the exact word.
> So in the case of "test/dma: add basic dmadev instance tests",
> the lowercase word "dmadev" was wrongly suggested to be uppercase.
> 
> The words of the dictionary must be filtered as whole word
> with the grep option -w.
> 
> Fixes: d448efa259e9 ("devtools: export dictionary for commit title check")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Applied
  

Patch

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 9988bf863d..885d444b3d 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -111,12 +111,12 @@  IFS='
 '
 words="$selfdir/words-case.txt"
 for word in $(cat $words); do
-	bad=$(echo "$headlines" | grep -iw $word | grep -v $word)
+	bad=$(echo "$headlines" | grep -iw $word | grep -vw $word)
 	if [ "$word" = "Tx" ]; then
 		bad=$(echo $bad | grep -v 'OCTEON\ TX')
 	fi
 	for bad_line in $bad; do
-		bad_word=$(echo $bad_line | cut -d":" -f2 | grep -io $word)
+		bad_word=$(echo $bad_line | cut -d":" -f2 | grep -iwo $word)
 		[ -z "$bad_word" ] || { printf "Wrong headline case:\n\
 			\"$bad_line\": $bad_word --> $word\n" && failure=true;}
 	done