Skip to content

Add Node.docstring and import alias helpers#35

Open
ggueret wants to merge 1 commit into
mainfrom
feat/utils-helpers-and-docstring
Open

Add Node.docstring and import alias helpers#35
ggueret wants to merge 1 commit into
mainfrom
feat/utils-helpers-and-docstring

Conversation

@ggueret
Copy link
Copy Markdown
Contributor

@ggueret ggueret commented May 28, 2026

Summary

  • Adds Node.docstring() (mixin method) returning the module/function/class docstring text or None.
  • Adds iter_import_aliases() and the ImportAlias NamedTuple in rude.utils, absorbing the three import node types (plain, from, __future__).
  • Re-exports extract_string_content, iter_import_aliases, ImportAlias at the top-level rude namespace.

Test plan

  • Node.docstring() extracts from module, function, class; returns None when absent or non-eligible; handles triple-single-quote
  • iter_import_aliases() yields correct (full_name, alias, is_from) for plain, aliased, dotted, from-import, multi-name, and __future__ imports
  • Top-level from rude import extract_string_content, iter_import_aliases, ImportAlias works

@ggueret ggueret self-assigned this May 28, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 74.64789% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
python/rude/utils.py 72.00% 14 Missing ⚠️
python/rude/core/node.py 80.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

1 participant