Revert "`ast.NodeVisitor` for import tracking (#7229)" by youknowone · Pull Request #7230 · RustPython/RustPython
Caution
Review failed
The pull request is closed.
ℹ️ Recent review info
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
scripts/update_lib/cmd_todo.pyscripts/update_lib/deps.py
📝 Walkthrough
Walkthrough
Narrowed test→library name extraction to only strip the "test_" prefix and refactored import parsing from an AST-based ImportVisitor to regex-based functions (_extract_top_level_code, parse_test_imports, parse_lib_imports) in the update_lib scripts.
Changes
| Cohort / File(s) | Summary |
|---|---|
Test Library Name Mapping scripts/update_lib/cmd_todo.py |
Changed lib_name derivation to remove only the test_ prefix (no longer strips trailing _test). |
Import Parsing Refactor scripts/update_lib/deps.py |
Removed AST ImportVisitor; added _extract_top_level_code, parse_test_imports, parse_lib_imports, and regex constants; changed import-detection and TODO counting to use the new functions. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- Improve deps output #6874: Modifies update_lib import parsing and test→lib name handling similarly.
ast.NodeVisitorfor import tracking #7229: Directly alters the same test-to-library name extraction in compute_test_todo_list.- [update_lib] show dependent tests in
depssubcommand #6828: Replaces AST-based import parsing with regex-based functions and adds _extract_top_level_code.
Suggested labels
skip:ci
Suggested reviewers
- ShaharNaveh
- moreal
Poem
🐰 I hop through code with whiskers twitching bright,
I trim one "test_" and keep the rest just right,
From AST forests to regex meadows I bound,
Counting todos and imports with a nimble sound,
A tiny rabbit cheering for changes found!
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.