Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ exclude = [
"venv",
"typings",
"tests/fixtures/malformed.py",
"tests/fixtures/sample_type_aliases.py",
]
Comment on lines 32 to 36
extend-include = ["*.ipynb"]
fix = true
Expand Down
9 changes: 4 additions & 5 deletions src/exportify/analysis/ast_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def parse_file(self, file_path: Path) -> AnalysisResult:
)

# Extract symbols (both defined and imported)
defined_symbols = self._extract_symbols(tree, file_path)
imported_symbols = self._extract_import_symbols(tree, file_path)
defined_symbols = self._extract_symbols(tree)
imported_symbols = self._extract_import_symbols(tree)
all_symbols = defined_symbols + imported_symbols

# Extract imports as strings for backward compatibility/caching
Expand All @@ -86,12 +86,11 @@ def parse_file(self, file_path: Path) -> AnalysisResult:
declared_all=declared_all,
)

def _extract_symbols(self, tree: ast.Module, file_path: Path) -> list[DetectedSymbol]:
def _extract_symbols(self, tree: ast.Module) -> list[DetectedSymbol]:
"""Extract all exportable symbols from AST.

Args:
tree: Parsed AST module
file_path: Path to source file (for error reporting)

Returns:
List of detected symbols
Expand Down Expand Up @@ -252,7 +251,7 @@ def _determine_variable_type(self, name: str, annotation: ast.expr | None) -> Me
# Default to variable
return MemberType.VARIABLE

def _extract_import_symbols(self, tree: ast.Module, file_path: Path) -> list[DetectedSymbol]:
def _extract_import_symbols(self, tree: ast.Module) -> list[DetectedSymbol]:
"""Extract import statements as ParsedSymbol objects.

Categorizes imports with heuristic metadata to help distinguish likely re-exports
Expand Down
Loading