summaryrefslogtreecommitdiff
path: root/util/lint
diff options
context:
space:
mode:
authorMartin Roth <martinroth@google.com>2016-01-25 16:38:05 -0700
committerMartin Roth <martinroth@google.com>2016-01-30 17:27:30 +0100
commit819e67242fa632f465f002396dc7adaec9418ab3 (patch)
tree124ffd040e752e5ac651cd86f1508e8ab4111059 /util/lint
parent572a856b97b25e359c1468cf1b059210728b3762 (diff)
downloadcoreboot-819e67242fa632f465f002396dc7adaec9418ab3.tar.xz
kconfig_lint: merge 'git grep' and 'grep' exclude dir and files
The code had originally been using standard grep to look through the coreboot tree for Kconfig symbols. When this was switched to git grep, the --exclude-dir options didn't work, and nothing was added to exclude the directories that shouldn't be searched for symbols. This resulted in invalid warnings as it searched directories that had Kconfig symbols for other projects. This merges the exclusion list for both the regular and git versions of grep for consistent behavior. Change-Id: I7fed8b9fa827cb14f7373e7b774acc56e43cb6ff Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/13459 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util/lint')
-rwxr-xr-xutil/lint/kconfig_lint17
1 files changed, 16 insertions, 1 deletions
diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint
index 2cb125e4b8..93843367ff 100755
--- a/util/lint/kconfig_lint
+++ b/util/lint/kconfig_lint
@@ -612,6 +612,21 @@ sub build_and_parse_kconfig_tree {
show_error("$line ($filename:$line_no unrecognized)");
}
+ if ( defined $inside_menu[0] ) {
+ $parseline[0]{menus} = "";
+ }
+ else {
+ $parseline[0]{menus} = "top";
+ }
+
+ my $i = 0;
+ while ( defined $inside_menu[$i] ) {
+ $parseline[0]{menus} .= "$inside_menu[$i]";
+ $i++;
+ if ( defined $inside_menu[$i] ) {
+ $parseline[0]{menus} .= "->";
+ }
+ }
push @wholeconfig, @parseline;
}
}
@@ -1135,7 +1150,7 @@ sub print_wholeconfig {
#replace tabs with spaces for consistency
$line->{text} =~ s/\t/ /g;
- printf "%-120s # $line->{filename} line $line->{file_line_no}\n", $line->{text};
+ printf "%-120s # $line->{filename} line $line->{file_line_no} ($line->{menus})\n", $line->{text};
}
}