Re: [dpdk-dev] [PATCH v3] devtools: export title syntax data for check-git-log
From: Thomas Monjalon <hidden>
Date: 2020-02-25 20:27:56
24/02/2020 16:30, Ferruh Yigit:
From: Sean Morrissey <redacted> Moved title syntax to a separate file so that it improves code readability and allows easy addition. Also logic changed from checking for bad pattern to checking good pattern which documents the expected syntax more clearly, and does not have gaps in the checks. Signed-off-by: Sean Morrissey <redacted> Signed-off-by: Ferruh Yigit <redacted> --- +words="$selfdir/words-case.txt" +for word in $(cat $words); do
I think we should exclude comments in the words file.
+ bad=$(echo "$headlines" | grep -iw $word | grep -v $word) + if [ "$word" = "Tx" ]; then + bad=$(echo $bad | grep -v 'OCTEON\ TX') + fi
We could try to manage such false positive automatically by excluding valid patterns while patterns list is iterated. If OCTEON TX is before Tx in the list, no confusion is possible.
+ for bad_line in $bad; do + bad_word=$(echo $bad_line | cut -d":" -f2 | grep -io $word)
The cut will ignore anything after a second colon. Should not happen but a possible minor issue.
+ if [ -n "$bad_word" ]; then + printf "Wrong headline case:\n\"$bad_line\": $bad_word --> $word\n" + fi + done +done
I think it is good enough to be merged. We can adress above improvements in a separate patch. Applied, thanks