summaryrefslogtreecommitdiff
path: root/bin/find-unneeded-includes
diff options
context:
space:
mode:
Diffstat (limited to 'bin/find-unneeded-includes')
-rwxr-xr-xbin/find-unneeded-includes15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index bdff09bf23eb..8197e9bf6814 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -28,6 +28,7 @@ import sys
import threading
import yaml
import argparse
+import pathlib
def ignoreRemoval(include, toAdd, absFileName, moduleRules):
@@ -341,6 +342,20 @@ def main(argv):
print ("File 'compile_commands.json' does not exist, please run:\nmake vim-ide-integration")
sys.exit(-1)
+ # quickly sanity check whether files with exceptions in yaml still exists
+ # only check for the module of the very first filename passed
+ moduleName = sorted(list_of_files)[0].split("/")[0]
+ rulePath = os.path.join(moduleName, "IwyuFilter_" + moduleName + ".yaml")
+ moduleRules = {}
+ if os.path.exists(rulePath):
+ moduleRules = yaml.full_load(open(rulePath))
+ if "excludelist" in moduleRules.keys():
+ excludelistRules = moduleRules["excludelist"]
+ for pathname in excludelistRules.keys():
+ file = pathlib.Path(pathname)
+ if not file.exists():
+ print("WARNING: File listed in " + rulePath + " no longer exists: " + pathname)
+
tidy(compileCommands, paths=list_of_files, dontstop=vars(args)["continue"])
if __name__ == '__main__':