Skip to content

Make the libcst (CST) backend usable for recipes - #270

Open
FrancescoPezzella wants to merge 7 commits into
astnode-change-minorfrom
libcst-replace-framework
Open

FrancescoPezzella wants to merge 7 commits into
astnode-change-minorfrom
libcst-replace-framework

Conversation

@FrancescoPezzella

@FrancescoPezzella FrancescoPezzella commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

This PR makes PythonCstNode (the libcst backend) usable by recipes, as a step towards ADR 11 (libcst for Python, still a Proposal) and the "don't reinvent the wheel" point in #104 and #14. The RST backend stays the default, so existing recipes behave the same.

The scope is deliberately minimal: only what is needed in #202 to not duplicate a lot of code, and to be able to actually use what is in the framework

Relates to #14 #104 #153 #188 #189 #261 #265 #266
Does not fully resolve any direct issue

@FrancescoPezzella FrancescoPezzella self-assigned this Oct 9, 2026
@FrancescoPezzella FrancescoPezzella added the python language Issues related to analysis and transformation of the Python language label Oct 9, 2026
@FrancescoPezzella

Copy link
Copy Markdown
Collaborator Author

@FrancescoPezzella
FrancescoPezzella changed the base branch from main to astnode-change-minor October 12, 2026 09:39
…pansThe three CST xfails in test_offset_encoding now pass; spans match the RST backend (decorators included, trailing newline excluded).
references/referenced_by link each use to its definition (string annotations included), so MatchFinder's reference matching now works on the CST backend.
@FrancescoPezzella
FrancescoPezzella added this pull request to stack #277 October 12, 2026 09:55
PythonRefactoring is generic over the node class (RST by default), and body returns the module's top-level statements on both backends.
@FrancescoPezzella FrancescoPezzella changed the title libcst tbd Make the libcst (CST) backend usable for recipes Oct 12, 2026
@FrancescoPezzella
FrancescoPezzella marked this pull request as ready for review October 12, 2026 12:19
@FrancescoPezzella FrancescoPezzella added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request python language Issues related to analysis and transformation of the Python language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant