Martin Roth | daa9e12 | 2016-01-11 14:35:24 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # This file is part of the coreboot project. |
| 3 | # |
| 4 | # Copyright 2016 Google Inc. |
| 5 | # |
| 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. |
| 9 | # |
| 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. |
| 14 | # |
Martin Roth | 5a70d6b | 2016-01-31 15:17:34 -0700 | [diff] [blame] | 15 | # DESCR: check Kconfig files for warnings and errors |
Martin Roth | daa9e12 | 2016-01-11 14:35:24 -0700 | [diff] [blame] | 16 | |
| 17 | LC_ALL=C export LC_ALL |
Martin Roth | 5a70d6b | 2016-01-31 15:17:34 -0700 | [diff] [blame] | 18 | |
| 19 | # Verify that the test can run, tell users the issue |
| 20 | if [ -z "$(command -v perl)" ]; then |
| 21 | echo "The kconfig lint tool uses perl. Please install it to run this test." |
| 22 | fi |
| 23 | |
| 24 | # If coreboot is in a git repo, use git grep to check as it will ignore any |
| 25 | # files in the tree that aren't checked into git |
Alex Thiessen | 73f19dc | 2018-01-16 23:05:48 +0000 | [diff] [blame] | 26 | if [ -n "$(command -v git)" ] && \ |
| 27 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 28 | then |
Martin Roth | 5a70d6b | 2016-01-31 15:17:34 -0700 | [diff] [blame] | 29 | env perl util/lint/kconfig_lint |
| 30 | else |
| 31 | env perl util/lint/kconfig_lint --no_git_grep |
| 32 | fi |