switch-coreboot/util/lint/lint-007-checkpatch
Martin Roth 4d3d353c47 UPSTREAM: util/lint: Don't run checkpatch on the documentation
BUG=none
BRANCH=none
TEST=none

Change-Id: Ia4f66233046dedd21e2bc5bf48ca7d7d514612b4
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 2a063beb71
Original-Change-Id: Ib95a7c9c64c481af7dcf1074ffc0fc76dc6b6ff9
Original-Signed-off-by: Martin Roth <gaumless@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/19144
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Original-Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/486751
2017-04-26 09:20:56 -07:00

43 lines
1.2 KiB
Bash
Executable file

#!/bin/sh
# This file is part of the coreboot project.
#
# Copyright 2015 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# DESCR: Checkpatch on .c, .h, & Kconfig files in the tree
LC_ALL=C export LC_ALL
# GNU BRE syntax list of files to examine
INCLUDED_FILES='.*\.[ch]\|Kconfig.*$'
EXCLUDED_DIRS="^payloads/libpayload/util/kconfig\|\
^payloads/libpayload/curses/PDCurses\|\
^util/kconfig\|\
^src/vendorcode\|\
^Documentation"
# Space separated list of directories to test
if [ "$1" = "" ]; then
INCLUDED_DIRS="src util"
else
INCLUDED_DIRS="$1"
fi
# We want word splitting here, so disable the shellcheck warnings
# shellcheck disable=SC2046,SC2086
FILELIST=$( git ls-files $INCLUDED_DIRS | \
grep $INCLUDED_FILES | \
grep -v $EXCLUDED_DIRS )
for FILE in $FILELIST; do
util/lint/checkpatch.pl --show-types --file --quiet "$FILE"
done