🧹 Code Health: Remove unused file_path arg from _extract_symbols#12
🧹 Code Health: Remove unused file_path arg from _extract_symbols#12bashandbone merged 2 commits intomainfrom
file_path arg from _extract_symbols#12Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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_pathargument from AST symbol extraction helpers and update call sites. - Fix the “pre-3.12” section in the
sample_type_aliases.pyfixture to useX: 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.
| # Dummy usage of type aliases to keep static analyzers happy. | ||
| test_file_path: FilePath | None = None | ||
|
|
||
| from typing import TypeAlias |
| "venv", | ||
| "typings", | ||
| "tests/fixtures/malformed.py", | ||
| "tests/fixtures/sample_type_aliases.py", | ||
| ] |
Signed-off-by: Adam Poulemanos <89049923+bashandbone@users.noreply.github.com>
🎯 What: The code health issue addressed was an unused parameter
file_pathinASTParser._extract_symbols(and also in_extract_import_symbols).💡 Why: Removing dead code and unused parameters improves readability and maintainability.
✅ Verification: Ran
uv run pytestand verified all tests pass. Had to adjust thetests/fixtures/sample_type_aliases.pytest fixture because it was improperly using 3.12+ style aliases in its "pre-3.12" section, and added it toruff.tomlexcludes 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