From ae245cdde94432e01f2a4cd7b695c766ae6f569d Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Thu, 8 Nov 2018 23:37:33 +0100 Subject: 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: Miklos Vajna --- bin/find-unneeded-includes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes index c949c887d905..ecc29fe32919 100755 --- a/bin/find-unneeded-includes +++ b/bin/find-unneeded-includes @@ -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) -- cgit