[coreboot-gerrit] New patch to review for coreboot: kconfig_lint: merge 'git grep' and 'grep' exclude dir and files

Martin Roth (martinroth@google.com) gerrit at coreboot.org
Tue Jan 26 04:17:52 CET 2016


Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13459

-gerrit

commit 067e885fda87ed78d825f8884e8cf26da5b518bb
Author: Martin Roth <martinroth at google.com>
Date:   Mon Jan 25 16:38:05 2016 -0700

    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 at google.com>
---
 util/lint/kconfig_lint | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/util/lint/kconfig_lint b/util/lint/kconfig_lint
index 2cb125e..9384336 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};
     }
 }
 



More information about the coreboot-gerrit mailing list