Skip to content

Commit 7b21f63

Browse files
committed
formating parse_document function
1 parent 2292689 commit 7b21f63

File tree

1 file changed

+5
-7
lines changed
  • supporting-blog-content/github-assistant

1 file changed

+5
-7
lines changed

supporting-blog-content/github-assistant/index.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ def parse_documents():
123123
)
124124

125125
if len(matching_files) > 0:
126-
file_summary.append(
127-
f"Found {len(matching_files)} {", ".join(extensions)} files in the repository."
128-
)
126+
extension_list = ", ".join(extensions)
127+
file_summary.append(f"Found {len(matching_files)} {extension_list} files in the repository.")
128+
129129
loader = SimpleDirectoryReader(
130130
input_dir=local_repo_path, required_exts=extensions, recursive=True
131131
)
@@ -136,10 +136,8 @@ def parse_documents():
136136

137137
nodes.extend(parsed_nodes)
138138
else:
139-
file_summary.append(
140-
f"Found {len(matching_files)} {', '.join(extensions)} files in the repository."
141-
)
142-
139+
extension_list = ", ".join(extensions)
140+
file_summary.append(f"No {extension_list} files found in the repository.")
143141

144142
collect_and_print_file_summary(file_summary)
145143
print("\n")

0 commit comments

Comments
 (0)