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>
This commit is contained in:
parent
572a856b97
commit
819e67242f
|
@ -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};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue