summaryrefslogtreecommitdiff
path: root/util/lint
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2020-05-18 13:25:18 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-05-28 09:38:03 +0000
commitd2fea1ab2112185ce73b1730ddb5a093066c063a (patch)
treed57339e9b4d04b95dc1dddf92609f52ff6efeb73 /util/lint
parentb4ab1e78cdda18fffb4dffd611300e3537315c17 (diff)
util/lint: Check for SPDX identifiers by default
The majority of the codebase has been converted to use SPDX identifiers now, so let's enforce those by default. The only exceptions are src/include and src/lib, which are not being checked since many of the files there do not have license headers at all. Files with custom licenses that aren't covered by SPDX can be listed as exceptions at the top of lint-000-license-headers. Change-Id: Ie6642153793d5735c74c5950bc9e27ee7eecacbc Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Reviewed-on: https://review.coreboot.org/c/coreboot/+/41602 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/lint')
-rwxr-xr-xutil/lint/lint-000-license-headers22
-rwxr-xr-xutil/lint/lint-stable-000-license-headers19
2 files changed, 4 insertions, 37 deletions
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
index eb14a94632..3f62a9b105 100755
--- a/util/lint/lint-000-license-headers
+++ b/util/lint/lint-000-license-headers
@@ -60,8 +60,6 @@ cmos\.layout|\
cmos\.default\
"
-HEADER_TEXT="license header"
-
#space separated list of directories to test
if [ "$1" = "" ]; then
HEADER_DIRS="src util"
@@ -69,11 +67,6 @@ else
HEADER_DIRS="$1"
fi
-if [ "$2" = "SPDX_ONLY" ]; then
- SPDX_ONLY=1
- HEADER_TEXT="SPDX identifier"
-fi
-
LC_ALL=C export LC_ALL
#get initial list from git, removing HEADER_EXCLUDED files.
@@ -122,24 +115,11 @@ check_for_license 'SPDX-License-Identifier: X11'
# differentiate between this license with or without advertising.
check_for_license 'SPDX-License-Identifier: BSD-4-Clause-UC'
-if [ ! "${SPDX_ONLY}" = "1" ]; then
-check_for_license "under the terms of the GNU General Public License" \
- "WITHOUT ANY WARRANTY"
-check_for_license 'IS PROVIDED .*"AS IS"'
-check_for_license 'IS DISTRIBUTED .*"AS IS"'
-check_for_license "IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE"
-check_for_license '"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES'
-check_for_license 'assumes any liability or responsibility for the use'
-check_for_license 'THE AUTHORS DISCLAIM.*ALL WARRANTIES WITH REGARD TO THIS SOFTWARE'
-check_for_license 'No license required'
-check_for_license 'GNU Lesser General Public'
-fi
-
for file in $headerlist; do
# Verify the file exists, and has content that requires a header
# This assumes that a file that has 4 lines or fewer is not notable
# enough to require a license.
if [ -f "$file" ] && [ "$(wc -l < "$file")" -gt 4 ]; then
- echo "$file has no recognized ${HEADER_TEXT}."
+ echo "$file has no recognized SPDX identifier."
fi
done
diff --git a/util/lint/lint-stable-000-license-headers b/util/lint/lint-stable-000-license-headers
index 7b14b45477..a29c5d42dc 100755
--- a/util/lint/lint-stable-000-license-headers
+++ b/util/lint/lint-stable-000-license-headers
@@ -3,20 +3,7 @@
#
# DESCR: Check that files have license headers
-# Directories requiring SPDX Identifiers only
-util/lint/lint-000-license-headers "src/acpi" SPDX_ONLY
-util/lint/lint-000-license-headers "src/arch" SPDX_ONLY
-util/lint/lint-000-license-headers "src/superio" SPDX_ONLY
-
# Top level
-util/lint/lint-000-license-headers "src/commonlib src/console \
- src/cpu src/device src/ec src/mainboard src/northbridge src/soc \
- src/southbridge"
-
-# src/drivers
-util/lint/lint-000-license-headers "src/drivers/ams src/drivers/aspeed src/drivers/dec src/drivers/elog \
- src/drivers/emulation src/drivers/gic src/drivers/ics src/drivers/ipmi src/drivers/maxim \
- src/drivers/parade src/drivers/ricoh src/drivers/sil src/drivers/ti src/drivers/usb src/drivers/xgi"
-
-# src/security
-util/lint/lint-000-license-headers "src/security/vboot"
+util/lint/lint-000-license-headers "src/acpi src/arch src/commonlib src/console \
+ src/cpu src/device src/drivers src/ec src/mainboard src/northbridge \
+ src/security src/soc src/southbridge src/superio"