History

checkkconfigsymbols.py: fix sorted output

Commit b1a3f243485f ("checkkconfigsymbols.py: make it Git aware") mistakenly removed to print undefined Kconfig symbols in alphabetical order. Furthermore, the script does not print anything anymore when the entire tree is checked (i.e., when no commit is specified). This patch restores the sorted output and adds the missing print for the default case. Additionally, the file lists are now sorted as well which (a) makes it easier to read and (b) makes the output deterministic.

Valentin Rothberg committed 11 years ago

Commit e9533ae1 parent a0871461 file · +7 −5Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/checkkconfigsymbols.py+7−5
@@ -112,14 +112,15 @@ def main(): · 111 unmodified lines
112112 undefined_b = check_symbols()
113113
114114 # report cases that are present for the commit but not before
115− for feature in undefined_b:
115+ for feature in sorted(undefined_b):
116116 # feature has not been undefined before
117117 if not feature in undefined_a:
118− files = undefined_b.get(feature)
118+ files = sorted(undefined_b.get(feature))
119119 print "%s\t%s" % (feature, ", ".join(files))
120120 # check if there are new files that reference the undefined feature
121121 else:
122− files = undefined_b.get(feature) - undefined_a.get(feature)
122+ files = sorted(undefined_b.get(feature) -
123+ undefined_a.get(feature))
123124 if files:
124125 print "%s\t%s" % (feature, ", ".join(files))
125126
@@ -129,8 +130,9 @@ def main(): · 3 unmodified lines
129130 # default to check the entire tree
130131 else:
131132 undefined = check_symbols()
132− for feature in undefined:
133− files = undefined.get(feature)
133+ for feature in sorted(undefined):
134+ files = sorted(undefined.get(feature))
135+ print "%s\t%s" % (feature, ", ".join(files))
134136
135137
136138 def execute(cmd):