Skip to content

Commit

Permalink
Python symbols parsing is now skipping private modules
Browse files Browse the repository at this point in the history
  • Loading branch information
notdanilo committed Oct 16, 2023
1 parent 9591c73 commit 6bc2e58
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ecosystem/python/parser/src/symbols/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ impl Parser<Directory<'_>> for ModuleParser {
.map(String::from)
.unwrap_or_default();
if extension == "py" || path.is_dir() {
let module = self.parse(path.as_path())?;
if let Some(existing) = modules
.iter_mut()
.find(|existing| existing.identifier == module.identifier)
{
existing.join(module)
} else {
modules.push(module);
if let Ok(module) = self.parse(path.as_path()) {
if let Some(existing) = modules
.iter_mut()
.find(|existing| existing.identifier == module.identifier)
{
existing.join(module)
} else {
modules.push(module);
}
}
}
}
Expand Down

0 comments on commit 6bc2e58

Please sign in to comment.