From cf5cad627108462114ef252491f03bfcb3ed1968 Mon Sep 17 00:00:00 2001 From: John Pennycook Date: Thu, 7 Mar 2024 08:20:58 -0800 Subject: [PATCH] Warn if no files found in a compilation database Signed-off-by: John Pennycook --- codebasin/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codebasin/config.py b/codebasin/config.py index 26ba7fa..07e8569 100644 --- a/codebasin/config.py +++ b/codebasin/config.py @@ -495,6 +495,12 @@ def load_database(dbpath, rootdir): else: log.warning("Couldn't find file %s -- ignoring it.", path) + if len(configuration) == 0: + log.warning( + f"No files found in compilation database at '{dbpath}'.\n" + + "Ensure that 'directory' and 'file' are in the root directory.", + ) + return configuration