find-unneeded-includes: warn first time user nicely about missing file

Change-Id: Ibc0b818a410cf0aee19b1d2a42a53db9aff87638
Reviewed-on: https://gerrit.libreoffice.org/76461
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
Gabor Kelemen
2019-07-26 22:18:10 +02:00
committed by Miklos Vajna
parent 0d36b32755
commit fc6b31910f

View File

@@ -296,8 +296,12 @@ def main(argv):
print("usage: find-unneeded-includes [FILE]...")
return
with open("compile_commands.json", 'r') as compileCommandsSock:
compileCommands = json.load(compileCommandsSock)
try:
with open("compile_commands.json", 'r') as compileCommandsSock:
compileCommands = json.load(compileCommandsSock)
except FileNotFoundError:
print ("File 'compile_commands.json' does not exist, please run:\nmake vim-ide-integration")
sys.exit(-1)
tidy(compileCommands, paths=argv)