[dpdk-dev] [PATCH v3] devtools: add new SPDX license compliance checker

Thomas Monjalon thomas at monjalon.net
Sat Feb 22 16:43:13 CET 2020


07/02/2020 18:52, Stephen Hemminger:
> Simple script to look for drivers and scripts that
> are missing requires SPDX header.
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
>  devtools/spdx-check.sh | 24 ++++++++++++++++++++++++

For consistency with other scripts, it should be named check-spdx.sh

Please add the new file in MAINTAINERS file in the section
"Developers and Maintainers Tools".

I think it should be mentioned also in the contributors guide.


> --- /dev/null
> +++ b/devtools/spdx-check.sh
> @@ -0,0 +1,24 @@
> +#! /bin/sh
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright (c) 2019 Microsoft Corporation

While talking about license, are you sure the (c) is required?


> +#
> +# Produce a list of files with incorrect license
> +# information

In order to add this script in a CI, it should return an error code.
Based on the error code, the CI can report it as success, warning or failure
to patchwork.


> +
> +echo "Files without SPDX License"
> +echo "--------------------------"
> +
> +git grep -L SPDX-License-Identifier -- \
> +    ':^.git*' ':^.ci/*' ':^.travis.yml' \
> +    ':^README' ':^MAINTAINERS' ':^VERSION' ':^ABI_VERSION' \
> +    ':^*/Kbuild' ':^*/README' \
> +    ':^license/' ':^doc/' ':^config/' ':^buildtools/' \
> +    ':^*.cocci' ':^*.abignore' \
> +    ':^*.def' ':^*.map' ':^*.ini' ':^*.data' ':^*.cfg' ':^*.txt'

This should be considered a critical error.

> +
> +echo
> +echo "Files with additional license text"
> +echo "----------------------------------"
> +
> +git grep -l Redistribution -- \
> +    ':^license/' ':^/devtools/spdx-check.sh'

This should be considered as a warning.




More information about the dev mailing list