diff options
author | Gabor Kelemen <kelemen.gabor2@nisz.hu> | 2019-06-16 08:43:01 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-06-17 08:42:38 +0200 |
commit | 068ea3105873d3500da9591bd40cc627c78eef3e (patch) | |
tree | 6c31f563df3adf466308d7d88a0a19a508853370 /bin | |
parent | 13b6e5d50affa56cb9c449252227933ab0fa1268 (diff) |
find-unneeded-includes: show command line in case of IWYU error messages
In case of non self contained files IYYU gives only error messages.
Prepare for that and print the failing command for further investigation.
Change-Id: I744338ab14d4a6cba5e02f842ff74b156c5178a4
Reviewed-on: https://gerrit.libreoffice.org/74111
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/find-unneeded-includes | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes index 3a4e303bbfe6..d3177af8336a 100755 --- a/bin/find-unneeded-includes +++ b/bin/find-unneeded-includes @@ -153,9 +153,14 @@ def processIWYUOutput(iwyuOutput, moduleRules): inRemove = False toRemove = [] currentFileName = None + for line in iwyuOutput: line = line.strip() + # Bail out if IWYU gave an error due to non self-containedness + if re.match ("(.*): error: (.*)", line): + return -1 + if len(line) == 0: if inRemove: inRemove = False @@ -208,7 +213,9 @@ def run_tool(task_queue, failed_files): print("[IWYU] " + invocation.split(' ')[-1]) p = subprocess.Popen(invocation, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) retcode = processIWYUOutput(p.communicate()[0].decode('utf-8').splitlines(), moduleRules) - if retcode != 0: + if retcode == -1: + print("ERROR: A file is probably not self contained, check this commands output:\n" + invocation) + elif retcode > 0: print("ERROR: The following command found unused includes:\n" + invocation) failed_files.append(invocation) task_queue.task_done() |