Commit ca310ffd authored by Eric Paris's avatar Eric Paris

Sort output from hack/verify-flag-underscore.py

So we get some consistency and readability to the exceptions.txt
parent 99dc464c
...@@ -163,10 +163,12 @@ def get_flags(rootdir, files): ...@@ -163,10 +163,12 @@ def get_flags(rootdir, files):
if len(new_excluded_flags) != 0: if len(new_excluded_flags) != 0:
print("Found a flag declared with an _ but which is not explicitly listed as a valid flag name in hack/verify-flags/excluded-flags.txt") print("Found a flag declared with an _ but which is not explicitly listed as a valid flag name in hack/verify-flags/excluded-flags.txt")
print("Are you certain this flag should not have been declared with an - instead?") print("Are you certain this flag should not have been declared with an - instead?")
new_excluded_flags.sort()
print("%s" % "\n".join(new_excluded_flags)) print("%s" % "\n".join(new_excluded_flags))
sys.exit(1) sys.exit(1)
if len(new_flags) != 0: if len(new_flags) != 0:
print("Found flags in golang files not in the list of known flags. Please add these to hack/verify-flags/known-flags.txt") print("Found flags in golang files not in the list of known flags. Please add these to hack/verify-flags/known-flags.txt")
new_flags.sort()
print("%s" % "\n".join(new_flags)) print("%s" % "\n".join(new_flags))
sys.exit(1) sys.exit(1)
return list(flags) return list(flags)
...@@ -230,6 +232,7 @@ def main(): ...@@ -230,6 +232,7 @@ def main():
if len(bad_lines) != 0: if len(bad_lines) != 0:
if not args.skip_exceptions: if not args.skip_exceptions:
print("Found illegal 'flag' usage. If these are false positives you should running `hack/verify-flags-underscore.py -e > hack/verify-flags/exceptions.txt` to update the list.") print("Found illegal 'flag' usage. If these are false positives you should running `hack/verify-flags-underscore.py -e > hack/verify-flags/exceptions.txt` to update the list.")
bad_lines.sort()
for (relname, line) in bad_lines: for (relname, line) in bad_lines:
print("%s:%s" % (relname, line)) print("%s:%s" % (relname, line))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment