File tree Expand file tree Collapse file tree
src/vectorcode/subcommands/query Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def _prepare_formatted_result(
3030 logger .warning (f"Skipping non-existent file: { res } " )
3131 else :
3232 assert isinstance (res , Chunk )
33- if res .start is None or res .end is None :
33+ if res .start is None or res .end is None : # pragma: nocover
3434 logger .warning (
3535 "This chunk doesn't have line range metadata. Please try re-vectorising the project."
3636 )
@@ -73,14 +73,20 @@ def preprocess_query_keywords(configs: Config):
7373def verify_include (configs : Config ):
7474 if QueryInclude .path not in configs .include :
7575 configs .include .append (QueryInclude .path )
76- assert not (
76+ if (
7777 QueryInclude .chunk in configs .include
7878 and QueryInclude .document in configs .include
79- ), "`chunk` and `document` cannot be used at the same time for `--include`."
79+ ):
80+ logger .error (
81+ "`chunk` and `document` cannot be used at the same time for `--include`."
82+ )
83+ return False
84+ return True
8085
8186
8287async def query (configs : Config ) -> int :
83- verify_include (configs )
88+ if not verify_include (configs ):
89+ return 1
8490
8591 assert configs .query
8692 preprocess_query_keywords (configs )
You can’t perform that action at this time.
0 commit comments