[dpdk-dev] [PATCH] devtools: export title syntax for check-git-log

Thomas Monjalon thomas at monjalon.net
Sat Feb 22 21:38:24 CET 2020


Hi,

Sorry for not looking at this patch before.

25/10/2019 11:59, Sean Morrissey:
> Moved title syntax to a separate file so that it improves code readability
> and allows for easy addition of new correct title syntax in future cases.

I think it is a good idea for a reason which is not said here:
the logic is switched from checking bad patterns to checking good wording.

> Signed-off-by: Sean Morrissey <sean.morrissey at intel.com>
[...]
> +data="$selfdir/commit-title-syntax.txt"

The file is processed to check specifically the case of words,
so it should be renamed to something like words-case.txt
The file need to be added to MAINTAINERS file as well.

The variable name "data" is too vague. I suggest "words".

> +while IFS= read -r line

We should avoid "while" loop because it is a sub-shell,
so it forbids setting global variables as it is done
in another patch collecting stats:
	https://patches.dpdk.org/patch/65243/

"for" loop should be fine.

The variable name should be "word" I think.

> +do
> +	regex=":.*\<$line\>"
> +	bad=$(echo "$headlines" | grep -i $regex | grep \

If using -o option of grep, we can capture the word and compare directly
with the correct word. It will be also better when printing the error.

> +		-v ':.*\<OCTEON\ TX\>' )

I don't like having this exception but I have no better idea.
We can move it before the first grep so it will still work with grep -o.

> +	if ! [ -z "$bad" ]
> +	then
> +		bad=$(echo "$headlines" | grep --color=always -v $regex \
> +			| grep --color=always -i $regex \
> +			| sed 's,^,\t,')
> +		[ -z "$bad" ] || printf "Wrong headline case:\n$bad\n"

As said above, the word can be printed alone if using grep -o.

> +	fi
> +done < "$data"
>  
>  # special case check for VMDq to give good error message
>  bad=$(echo "$headlines" | grep -E --color=always \

The VMDq case should be moved as well.

> --- /dev/null
> +++ b/devtools/commit-title-syntax.txt
> @@ -0,0 +1,45 @@
> +Rx
> +Tx
> +PF
> +VF
> +HW
> +SW
> +FW
> +L2
> +L3
> +L4
> +API
> +arm

The right syntax is Arm.

> +aarch64

aarch32 is missing.

> +armv7
> +armv8
> +CRC
> +DCB
> +DMA
> +EEPROM
> +FreeBSD
> +IOVA
> +LACP
> +Linux
> +LRO
> +LSC
> +MAC
> +MSS
> +MTU
> +NIC
> +NVM
> +NUMA
> +PCI
> +PHY
> +PMD
> +RETA
> +RSS
> +SCTP
> +TOS
> +TPID
> +TSO
> +TTL
> +UDP
> +VLAN
> +VDPA

The right syntax is vDPA

> +VSI




More information about the dev mailing list