◐ Shell
clean mode source ↗

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

📥 Commits

Reviewing files that changed from the base of the PR and between 804a7e4 and bb5fd9e.

📒 Files selected for processing (2)
  • scripts/update_lib/cmd_todo.py
  • scripts/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

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.