Skip to content

🧹 Code Health: Remove unused file_path arg from _extract_symbols#12

Merged
bashandbone merged 2 commits intomainfrom
jules-1047894948606194520-c86366ea
Mar 13, 2026
Merged

🧹 Code Health: Remove unused file_path arg from _extract_symbols#12
bashandbone merged 2 commits intomainfrom
jules-1047894948606194520-c86366ea

Conversation

@bashandbone
Copy link
Contributor

🎯 What: The code health issue addressed was an unused parameter file_path in ASTParser._extract_symbols (and also in _extract_import_symbols).
💡 Why: Removing dead code and unused parameters improves readability and maintainability.
Verification: Ran uv run pytest and verified all tests pass. Had to adjust the tests/fixtures/sample_type_aliases.py test fixture because it was improperly using 3.12+ style aliases in its "pre-3.12" section, and added it to ruff.toml excludes to prevent auto-fixing UP040.
Result: Cleaned up internal API signatures and reduced unused parameters.


PR created automatically by Jules for task 1047894948606194520 started by @bashandbone

Removed the unused `file_path` argument from internal `_extract_symbols` and `_extract_import_symbols` methods in the AST parser to clean up the code.

Also updated a test fixture to ensure `pre-python3.12` style annotations work properly, and excluded it from Ruff's UP040 fix so it won't be auto-updated to the `type` keyword.

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings March 13, 2026 02:32
type ErrorMessage = str
type ConfigDict = dict[str, str | int | bool | list[str]]
type NamePair = tuple[str, str]
FilePath: TypeAlias = str | Path
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes an unused file_path parameter from ASTParser._extract_symbols and _extract_import_symbols, and updates a type-alias fixture/config to keep type-alias detection tests stable.

Changes:

  • Remove unused file_path argument from AST symbol extraction helpers and update call sites.
  • Fix the “pre-3.12” section in the sample_type_aliases.py fixture to use X: TypeAlias = ....
  • Exclude the fixture from Ruff to prevent auto-fixing of intended test syntax.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/exportify/analysis/ast_parser.py Drops unused internal parameters and updates parse_file call sites accordingly.
tests/fixtures/sample_type_aliases.py Corrects pre-3.12 alias syntax and adds TypeAlias import for the fixture.
ruff.toml Excludes the fixture from Ruff runs to avoid undesired auto-fixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +22
# Dummy usage of type aliases to keep static analyzers happy.
test_file_path: FilePath | None = None

from typing import TypeAlias
Comment on lines 32 to 36
"venv",
"typings",
"tests/fixtures/malformed.py",
"tests/fixtures/sample_type_aliases.py",
]
Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
@bashandbone bashandbone merged commit efcb779 into main Mar 13, 2026
8 of 9 checks passed
@bashandbone bashandbone deleted the jules-1047894948606194520-c86366ea branch March 13, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants