blob: b13cb4487ed4e2bb28f1125cd3251ecf79feb4b1 [file] [log] [blame]
Martin Roth0ad5fbd2020-12-24 12:06:38 -07001#!/usr/bin/env sh
Martin Roth037dbe42017-06-03 21:15:57 -06002#
Patrick Georgi7333a112020-05-08 20:48:04 +02003# SPDX-License-Identifier: GPL-2.0-only
4
Martin Roth037dbe42017-06-03 21:15:57 -06005# DESCR: Verify that the word 'coreboot' is lowercase
6
7LC_ALL=C export LC_ALL
8
Martin Roth7e464dc2017-09-01 09:22:43 -06009EXCLUDE='^3rdparty/\|util/crossgcc/xgcc\|Binary file\|coreboot\|COREBOOT\|CorebootPayload\|CorebootModule\|minnowboard.org/Coreboot\|.*\.patch$\|CorebootBdsLib\|^payloads/external'
Martin Roth037dbe42017-06-03 21:15:57 -060010
11# Use git grep if the code is in a git repo, otherwise use grep.
Alex Thiessen73f19dc2018-01-16 23:05:48 +000012if [ -n "$(command -v git)" ] && \
13 [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
14then
Martin Roth037dbe42017-06-03 21:15:57 -060015 GREP_FILES="git grep -in"
16
17 # Check last commit message
18 if [ -n "$(git log -n 1 | grep -i 'coreboot' | grep -v "$EXCLUDE" )" ]; then
19 echo "'coreboot' should be lowercase in commit message"
20 fi
21else
22 GREP_FILES="grep -rin"
23fi
24
25${GREP_FILES} "coreboot" | grep -v "$EXCLUDE";