Kaydet (Commit) ae245cdd authored tarafından Gabor Kelemen's avatar Gabor Kelemen Kaydeden (comit) Miklos Vajna

find-unneeded-includes: sort the output

Default IWYU output is sorted alphabetically by filename

A more friendly way to present f-u-i information would be
to sort by line numbers: so that a developer can go through the removal
proposals in the editor top to bottom, without too much cursor positioning
in the list of 100 header lines to delete 20 of them.

The result is not perfect, because numbers in text are not naturally sorted:
line 205 will be listed between 20 and 21; but that's a really rare occasion

Change-Id: I8011321a299a76f5a32469a9d77eb8fcc4521034
Reviewed-on: https://gerrit.libreoffice.org/63144
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 3583f7a1
......@@ -176,7 +176,7 @@ def processIWYUOutput(iwyuOutput, moduleRules):
if not ignoreRemoval(fwdDecl, toAdd, currentFileName, moduleRules):
toRemove.append("%s:%s: %s" % (currentFileName, lineno, fwdDecl))
for remove in toRemove:
for remove in sorted(toRemove):
print("ERROR: %s: remove not needed include / forward declaration" % remove)
return len(toRemove)
......
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