blob: 3323971fac2057ae506d3329380f10e1bbd202ae [file] [log] [blame]
Martin Roth0ad5fbd2020-12-24 12:06:38 -07001#!/usr/bin/env sh
Martin Roth5a70d6b2016-01-31 15:17:34 -07002#
Patrick Georgi7333a112020-05-08 20:48:04 +02003# SPDX-License-Identifier: GPL-2.0-only
4
Angel Pons04bf41b2020-10-13 01:07:27 +02005# DESCR: Check Kconfig files for errors
Martin Roth5a70d6b2016-01-31 15:17:34 -07006
7LC_ALL=C export LC_ALL
8
9# Verify that the test can run, tell users the issue
10if [ -z "$(command -v perl)" ]; then
11 echo "The kconfig lint tool uses perl. Please install it to run this test."
12fi
13
14# If coreboot is in a git repo, use git grep to check as it will ignore any
15# files in the tree that aren't checked into git
Alex Thiessen73f19dc2018-01-16 23:05:48 +000016if [ -n "$(command -v git)" ] && \
17 [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
18then
Martin Rothb1bca882016-03-02 13:19:07 -070019 env perl util/lint/kconfig_lint --warnings_off 2>&1
Martin Roth5a70d6b2016-01-31 15:17:34 -070020else
Martin Rothb1bca882016-03-02 13:19:07 -070021 env perl util/lint/kconfig_lint --no_git_grep --warnings_off 2>&1
Martin Roth5a70d6b2016-01-31 15:17:34 -070022fi