Skip to content

Commit 89d9989

Browse files
authored
Merge pull request #117 from bridgetmcg/main
Update get_all_docstrings to return dict
2 parents 1b1c011 + 9d5a274 commit 89d9989

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cldk/analysis/java/codeanalyzer/codeanalyzer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,10 @@ def get_all_docstrings(self) -> List[Tuple[str, JComment]]:
10461046
Returns:
10471047
Dict[str, List[str]]: Dictionary of file paths and their corresponding docstrings.
10481048
"""
1049-
docstrings = []
1049+
docstrings = {}
10501050
for file_path, list_of_comments in self.get_all_comments().items():
1051-
docstrings += [(file_path, docstring) for docstring in list_of_comments if docstring.is_javadoc]
1051+
javadoc_comments = [docstring for docstring in list_of_comments if docstring.is_javadoc]
1052+
if javadoc_comments:
1053+
docstrings[file_path] = javadoc_comments
10521054

1053-
return docstrings
1055+
return docstrings

0 commit comments

Comments
 (0)