Skip to content

Commit e3892dd

Browse files
committed
address review
1 parent a75e5c0 commit e3892dd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

api/analyzers/source_analyzer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ def first_pass(self, path: Path, files: list[Path], ignore: list[str], graph: Gr
8181
executor (concurrent.futures.Executor): The executor to run tasks concurrently.
8282
"""
8383

84-
if any([file for file in files if file.suffix == ".java"]):
85-
analyzers[".java"].add_dependencies(path, files)
86-
if any([file for file in files if file.suffix == ".py"]):
87-
analyzers[".py"].add_dependencies(path, files)
84+
supoorted_types = self.supported_types()
85+
for ext in set([file.suffix for file in files if file.suffix in supoorted_types]):
86+
analyzers[ext].add_dependencies(path, files)
8887

8988
files_len = len(files)
9089
for i, file_path in enumerate(files):

api/git_utils/git_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def build_commit_graph(path: str, analyzer: SourceAnalyzer, repo_name: str, igno
142142

143143
# apply deletions
144144

145+
# reating modified files as both deleted and added
145146
# remove deleted files from the graph
146147
if len(deleted + modified) > 0:
147148
logging.info(f"Removing deleted files: {deleted + modified}")
@@ -205,6 +206,7 @@ def build_commit_graph(path: str, analyzer: SourceAnalyzer, repo_name: str, igno
205206

206207
# apply deletions
207208

209+
# reating modified files as both deleted and added
208210
# remove deleted files from the graph
209211
if len(deleted + modified) > 0:
210212
logging.info(f"Removing deleted files: {deleted + modified}")

0 commit comments

Comments
 (0)