Repository navigation
Make the libcst (CST) backend usable for recipes - #270
Merged
Merged
Conversation
Collaborator
Author
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
October 11, 2026 12:15
cd60e49 to
9f4d682
Compare
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
October 12, 2026 09:53
cba56f6 to
803c953
Compare
FrancescoPezzella
marked this pull request as ready for review
October 12, 2026 12:19
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
October 16, 2026 11:49
5239d9d to
71bdd36
Compare
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
October 16, 2026 11:59
71bdd36 to
5ca06b5
Compare
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
October 19, 2026 09:13
7dea65a to
b7c3af4
Compare
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
October 26, 2026 09:20
b7c3af4 to
0536b58
Compare
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
2 times, most recently
from
October 29, 2026 12:55
1956d5c to
0a7d899
Compare
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
November 2, 2026 20:27
e8d47c7 to
baa811a
Compare
pjljvandelaar
left a comment
Collaborator
There was a problem hiding this comment.
Just some minor questions.
I will approve once answered.
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
2 times, most recently
from
November 4, 2026 08:55
78120d0 to
e8b320f
Compare
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
November 4, 2026 09:20
e8b320f to
c624504
Compare
…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.
PythonRefactoring is generic over the node class (RST by default), and body returns the module's top-level statements on both backends.
Add extra TODOs regarding AI docstrings.
libcst only links a use to definitions above it; annotations and type hints are evaluated lazily, so they now count too.
…8 bytes only, and state that the CST adapter's offsets count bytes of the filesystem encoding until that migration.
…, and build nodes of the subclass in its constructor and loaders so the annotation holds.
…e parsers, rewriter, text utilities and tests, with the explicit UTF-8 encoding in the Python loaders. Make Ci/Cd pass with Pyright fix.
… no assertion accesses an optional parent or sibling.
…tching the CST version of the test.
FrancescoPezzella
force-pushed
the
libcst-replace-framework
branch
from
November 5, 2026 09:46
c624504 to
3b2ae6c
Compare
Collaborator
Author
|
briefly discussed during meeting, will merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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