Martin Roth | 0ad5fbd | 2020-12-24 12:06:38 -0700 | [diff] [blame] | 1 | #!/usr/bin/env sh |
Martin Roth | daa9e12 | 2016-01-11 14:35:24 -0700 | [diff] [blame] | 2 | # |
Patrick Georgi | 7333a11 | 2020-05-08 20:48:04 +0200 | [diff] [blame] | 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
Angel Pons | 04bf41b | 2020-10-13 01:07:27 +0200 | [diff] [blame] | 5 | # DESCR: Check Kconfig files for warnings and errors |
Martin Roth | daa9e12 | 2016-01-11 14:35:24 -0700 | [diff] [blame] | 6 | |
| 7 | LC_ALL=C export LC_ALL |
Martin Roth | 5a70d6b | 2016-01-31 15:17:34 -0700 | [diff] [blame] | 8 | |
| 9 | # Verify that the test can run, tell users the issue |
| 10 | if [ -z "$(command -v perl)" ]; then |
| 11 | echo "The kconfig lint tool uses perl. Please install it to run this test." |
| 12 | fi |
| 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 Thiessen | 73f19dc | 2018-01-16 23:05:48 +0000 | [diff] [blame] | 16 | if [ -n "$(command -v git)" ] && \ |
| 17 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 18 | then |
Martin Roth | 5a70d6b | 2016-01-31 15:17:34 -0700 | [diff] [blame] | 19 | env perl util/lint/kconfig_lint |
| 20 | else |
| 21 | env perl util/lint/kconfig_lint --no_git_grep |
| 22 | fi |