From 1a9572e5057dfce1dfd65ac3478255df6eb19e62 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Tue, 24 Dec 2024 18:08:36 +0100 Subject: [PATCH] Sort bin/find-unneeded-includes results not naturally, but numerically so a hit in line 101 will be listed after the hit in line 99 not after the one in line 10 Change-Id: Ic5b3da80df20a3aeda7b1a71c8d6380371ed3ee8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179320 Reviewed-by: Gabor Kelemen Tested-by: Jenkins --- bin/find-unneeded-includes | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes index e93d62f38b8b..ec0a620c9090 100755 --- a/bin/find-unneeded-includes +++ b/bin/find-unneeded-includes @@ -410,10 +410,10 @@ def processIWYUOutput(iwyuOutput, moduleRules, fileName, noexclude, checknamespa subprocess.run(["git", "grep", "-n", "namespace.*[^a-zA-Z]"+nameSpace+" *;", fileName]) if removefwdd: - for remove in sorted(toRemove): + for remove in sorted(toRemove, key=lambda x: int(x.split(":")[1])): print("ERROR: %s: remove not needed forward declaration" % remove) else: - for remove in sorted(toRemove): + for remove in sorted(toRemove, key=lambda x: int(x.split(":")[1])): print("ERROR: %s: remove not needed include" % remove) return len(toRemove)