2 # This file is part of the coreboot project.
4 # Copyright (C) 2017 Google Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; version 2 of the License.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # DESCR: Verify that the word 'coreboot' is lowercase
17 LC_ALL
=C
export LC_ALL
19 EXCLUDE
='^3rdparty/\|util/crossgcc/xgcc\|Binary file\|coreboot\|COREBOOT\|CorebootPayload\|CorebootModule\|minnowboard.org/Coreboot\|.*\.patch$\|CorebootBdsLib\|^payloads/external'
21 # Use git grep if the code is in a git repo, otherwise use grep.
22 if [ -n "$(command -v git)" ] && \
23 [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
25 GREP_FILES
="git grep -in"
27 # Check last commit message
28 if [ -n "$(git log -n 1 | grep -i 'coreboot' | grep -v "$EXCLUDE" )" ]; then
29 echo "'coreboot' should be lowercase in commit message"
32 GREP_FILES
="grep -rin"
35 ${GREP_FILES} "coreboot" |
grep -v "$EXCLUDE";