Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
89358bb
Allow longer titles with pymarkdown, dependency and .gitignore folder
FrancescoPezzella Oct 15, 2026
c5024ab
Add the Refactoring recipes and rejected recipes docs and the Type pa…
FrancescoPezzella Oct 16, 2026
8870c9a
Add missing copyright
FrancescoPezzella Oct 16, 2026
9ebd679
Type ASTProcessor targets as Rewritable and make ASTReference generic…
FrancescoPezzella Oct 11, 2026
32e4241
Remove TYPE_CHECKING and add TODO
FrancescoPezzella Oct 12, 2026
5f920ec
Ruff TODO issues
FrancescoPezzella Oct 12, 2026
d734c65
Solve unrelated pyright issues to make pipeline pass
FrancescoPezzella Oct 12, 2026
f3735fe
Rename ReferencedT -> NodeProtocolT and clarify DocStrings
FrancescoPezzella Oct 16, 2026
650a0e1
Fix PythonCstNode offsets: UTF-8 bytes, end-of-file span, code-only s…
FrancescoPezzella Oct 9, 2026
374d0d9
Add libcst scope-based references to PythonCstNode
FrancescoPezzella Oct 10, 2026
a957618
Replace workaround with a reference to ASTReference
FrancescoPezzella Oct 11, 2026
05d7845
Let PythonRefactoring run on a chosen Python backend
FrancescoPezzella Oct 12, 2026
68a64a8
Clarify existing TODO with extra information, author and related issue.
FrancescoPezzella Oct 12, 2026
e06d60a
Placeholder Copyright comment, Lint issues and TODO comment for lazy …
FrancescoPezzella Oct 12, 2026
f6ba77a
Document the CST offsets, references and backend choice
FrancescoPezzella Oct 12, 2026
5ca06b5
Link annotations above a definition to it in the CST references.
FrancescoPezzella Oct 13, 2026
7dea65a
Add Copyright comment
FrancescoPezzella Oct 16, 2026
4053205
TypeVar: First initial version with testing
FrancescoPezzella Aug 26, 2026
f00e79b
TypeVar: Expanded upon the TypeVars - TypeVar/ParamSpec/TypeVarTuple.…
FrancescoPezzella Aug 26, 2026
06955c5
TypeVar: Added type checking and fixed as many linter problems that c…
FrancescoPezzella Aug 26, 2026
90857d4
Fixed a TODO bug with Snake_Case, file names with 2+ words were not c…
FrancescoPezzella Aug 27, 2026
df32a03
Extended TypeVarCheck to fully modernize TypeVar/ParamSpec/TypeVarTup…
FrancescoPezzella Aug 28, 2026
6d96dc0
Added a Python-version gate to TypeVarCheck (PEP 695 conversion only …
FrancescoPezzella Aug 28, 2026
e82bb79
Extracted type_var_domain.py (TypeVar/ParamSpec/TypeVarTuple domain m…
FrancescoPezzella Aug 31, 2026
f13eede
Fixed the 6 pyright strict findings in type_var_check.py/type_var_dom…
FrancescoPezzella Aug 31, 2026
f3744c8
Fix silent corruption when two rewrites target the same node (ast_rew…
FrancescoPezzella Aug 31, 2026
c213bbb
Fix silent corruption when two rewrites target the same node (ast_rew…
FrancescoPezzella Aug 31, 2026
30e712d
Fix TypeVarCheck corrupting or losing code during PEP 695 conversion
FrancescoPezzella Sep 1, 2026
57b961b
Ruff: Fixed and enabled (W)hitespace rule
FrancescoPezzella Sep 1, 2026
60852b0
Ruff: Enabled all unsafe fixes from other rules
FrancescoPezzella Sep 1, 2026
4092488
Fixed ruff releated formatting issues
FrancescoPezzella Sep 1, 2026
e9afd3f
Fix 2
FrancescoPezzella Sep 2, 2026
a4ce611
Applied ruff fixes
FrancescoPezzella Sep 2, 2026
070f4bc
Ruff fixes
FrancescoPezzella Sep 7, 2026
34e730b
Add migration-type-recipes.py CLI for TypeVarCheck
FrancescoPezzella Sep 8, 2026
639b831
CLI - both typevar and typevartuplecheck integrated
FrancescoPezzella Sep 8, 2026
2139086
Add Step/run_steps, refactor TypeVarCheck.check() to use it
FrancescoPezzella Sep 9, 2026
860cdb4
Removed dead code (which became irrelevant some ago), cleaned up some…
FrancescoPezzella Sep 9, 2026
85e2911
Delegate unused-import cleanup to ruff F401 (CLI will call Ruff, no n…
FrancescoPezzella Sep 9, 2026
b537c98
Rewrite CLI: remove dry-run (issues, easier to remove, git diff alrea…
FrancescoPezzella Sep 9, 2026
f903565
Marked two tests as failing due to an earlier fix
FrancescoPezzella Sep 10, 2026
79fc98b
Quote TYPE_CHECKING-only annotation, scope UP037 noqa to one line
FrancescoPezzella Sep 10, 2026
2c947ee
Ruff unsafe fix
FrancescoPezzella Sep 11, 2026
64d85df
'--review' now gives more information to the user regarding Type reci…
FrancescoPezzella Sep 11, 2026
24bbf05
Removed code duplication, fixed incorrect paths to files (before refa…
FrancescoPezzella Sep 11, 2026
6063c1f
Fixed a bug with the correct Python version not being identified by t…
FrancescoPezzella Sep 11, 2026
1910e93
Updated outdated Docs - removed references to deleted Python Kind Map
FrancescoPezzella Sep 14, 2026
f36a58e
Added feedback when processing each file with the Migration tool.
FrancescoPezzella Sep 14, 2026
5175cd0
Forced UTF until becomes Py 3.15 default
FrancescoPezzella Sep 16, 2026
d4f3993
New test, and cleaned up some old comments for tests
FrancescoPezzella Sep 17, 2026
cd75f15
Deleted incorrect files added during the rebase
FrancescoPezzella Sep 21, 2026
437604e
Rebase mistakes-
FrancescoPezzella Sep 21, 2026
d3c868d
Last rebase mistake
FrancescoPezzella Sep 21, 2026
f63b0a9
Add missing docstrings, reword existing ones, add missing import
FrancescoPezzella Sep 21, 2026
dd45946
TypeVar issues
FrancescoPezzella Sep 21, 2026
61fce5b
Add project-wide import safety to TypeVar localization
FrancescoPezzella Sep 22, 2026
94abe1f
Add missing docstrings to TypingRecipe related tests
FrancescoPezzella Sep 23, 2026
afad308
New test that shows a fault in the CLI
FrancescoPezzella Sep 23, 2026
8ee219a
Fix project_root wiring and relative paths in TypeVar import safety
FrancescoPezzella Sep 23, 2026
310c252
Clean up comments and doc strings
FrancescoPezzella Sep 23, 2026
57f301f
Add TODOs to migration tool
FrancescoPezzella Sep 23, 2026
f1499bb
Access TypeVars as model attributes
FrancescoPezzella Sep 23, 2026
af92c4b
Adjust CLI message and resolve path
FrancescoPezzella Sep 23, 2026
37c8b62
Fix outdated references
FrancescoPezzella Sep 23, 2026
e3bec3b
Cleaner docstring
FrancescoPezzella Sep 24, 2026
b59e4c6
Tool no longer looks for a Python Version in the project: was suspect…
FrancescoPezzella Sep 24, 2026
d6001ce
Removed failing test: CI/CD uses Linux environment (which is UTF-8 by…
FrancescoPezzella Sep 24, 2026
6a86ca1
Added an optional cmd for the user to not run Ruff with --no-ruff. Th…
FrancescoPezzella Sep 25, 2026
942a953
Refuse to localize a TypeVar whose origin imports its constructor con…
FrancescoPezzella Sep 30, 2026
dffbb68
Revert changes in ast_refactor_actions (handled in a separate PR)
FrancescoPezzella Oct 2, 2026
4afe68d
TODOs for 2 bugs
FrancescoPezzella Oct 2, 2026
9d68f0a
Remove disabled Ruff rule ignores, Clean up docstring and comment
FrancescoPezzella Oct 2, 2026
3055db3
Bug fix with Project Scanner: no longer enters excluded carpets, savi…
FrancescoPezzella Oct 2, 2026
80601d1
Docstring wording
FrancescoPezzella Oct 5, 2026
8b7bbb0
Remove TypeVarTupleCheck and its related tests have been removed or o…
FrancescoPezzella Oct 5, 2026
60b3cb1
Add tests with xfail regarding multilines and multiple Type Vars bein…
FrancescoPezzella Oct 5, 2026
389d1d1
Remove duplicate code
FrancescoPezzella Oct 6, 2026
0c16d73
Verify bug with TODO and fix another bug
FrancescoPezzella Oct 6, 2026
ee9cbf4
TODO for a bug
FrancescoPezzella Oct 6, 2026
9ea1332
TODO for another bug
FrancescoPezzella Oct 6, 2026
2bfd4e5
Both Step2 and Step3 from type_var_check no longer delete orphaned de…
FrancescoPezzella Oct 6, 2026
caef79c
Remove same name being shown twice in the CLI report and remove low v…
FrancescoPezzella Oct 6, 2026
0e7579a
Remove duplicate, low value, X is not present type tests
FrancescoPezzella Oct 7, 2026
c987dcc
Test with multiple TypeVars and their output order
FrancescoPezzella Oct 7, 2026
cee33e3
Fix test
FrancescoPezzella Oct 7, 2026
f3860d4
Remove `USED_OUTSIDE_FUNCTION` as a reason for not converting Type Pa…
FrancescoPezzella Oct 7, 2026
3348246
Combined Generic definition for 2 Generic related unsafe rules in typ…
FrancescoPezzella Oct 7, 2026
723a4cb
Remove `ORIGIN_CLASS_IS_GENERIC_OVER_NAME` and add `DECLARATION_NAME_…
FrancescoPezzella Oct 7, 2026
f687eaf
Remove 'ORIGIN_MODULE_EXPORTS_NAME' rule. TypeVar can be localized sa…
FrancescoPezzella Oct 7, 2026
3cffbdd
Big with TYPE_CHECKING fixed, test adjusted, text corrected
FrancescoPezzella Oct 7, 2026
434fedb
TypeVarCheck now conservs default= and converts it with Py 3.13+. Whe…
FrancescoPezzella Oct 8, 2026
be58c42
Clean up comments and docstrings
FrancescoPezzella Oct 8, 2026
3c273f3
Clean up tests
FrancescoPezzella Oct 8, 2026
2ed4c99
Docuement and test 3 bugs
FrancescoPezzella Oct 8, 2026
3f3394a
Add xfail to test which was incorrectly passing.
FrancescoPezzella Oct 9, 2026
a78e4d9
Lint errors and fixes for tests
FrancescoPezzella Oct 9, 2026
65051ac
Lint/ruff errors
FrancescoPezzella Oct 9, 2026
519fe85
Bug: Localize all TypeVars imported by one statement in a single edit
FrancescoPezzella Oct 9, 2026
b4cb5ef
Re-anchor a relatively imported TypeVar constructor on the localized …
FrancescoPezzella Oct 9, 2026
152ba33
Add any other form of `__all__ = [...]` as a Non-Goal (no patterns de…
FrancescoPezzella Oct 9, 2026
5a5349e
Replace narrowed_import_text with ast.unparse in TypeVarCheck._locali…
FrancescoPezzella Oct 9, 2026
7fbfc8b
Bring #202 within the lint budget
FrancescoPezzella Oct 12, 2026
127dbf1
TODOs regarding Py 3.15 lazy imports
FrancescoPezzella Oct 12, 2026
512d073
Add the official TNO copyright notice to new files
FrancescoPezzella Oct 16, 2026
91e346f
Update type parameter modernization documentation references
FrancescoPezzella Oct 16, 2026
2ec4d55
Port TypeVarCheck to libcst
FrancescoPezzella Oct 16, 2026
21bf5ea
Track the multi-line string re-indentation and PatternMatch placehold…
FrancescoPezzella Oct 13, 2026
e12c0e7
Track the TypeVarCheck bugs found in review in TODOs, and explain why…
FrancescoPezzella Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,6 @@ __marimo__/
**/*.dll
**/.*.so
**/*.dot

# Folder containing relevant presentations made with Marp
.marp_presentations
8 changes: 5 additions & 3 deletions docs/TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## Documentation gaps: action points for docs

### Stub pages that need content
Expand Down Expand Up @@ -35,9 +34,12 @@

15. **Scoping: skip and filter at the file level** (add to strategy-composition.md or a new page) — Java's `skipATU`, `globalFilter`, `sourceFilePostfixes`, and `sourceFileDirectories` provide coarse-grained scoping before any pattern matching runs. The Python equivalent concept needs documentation.


### New pages worth adding

19. **Common parser problems** (new page, e.g., `docs/developer/modules/parser-known-limitations.md`) — Java has CommonCdtParsingProblems.md listing concrete CDT/MSVC-extension parsing failures with workarounds. A Python equivalent covering known tree-sitter, libcst, clang binding, and ANTLR limitations would be directly useful.

20. **Related works and context** (new section in index.md or index.md) — The Java UserGuide.md relates the tool to WHARS and ADA tooling. Adding a "related works" section that situates Renaissance-Experiments relative to the Java version, comby, and other code transformation tools would help new contributors understand design choices.
20. **Related works and context** (new section in index.md or index.md) — The Java UserGuide.md relates the tool to WHARS and ADA tooling. Adding a "related works" section that situates Renaissance-Experiments relative to the Java version, comby, and other code transformation tools would help new contributors understand design choices.

### Naming

21. **Type parameter modernization: rename the recipe and update its code references** — The page and rule links use `type-parameter-modernization`, but the recipe is still `TypeVarCheck` (`type_var_check.py`, `type_var_domain.py`, `test_type_var_*`). Rename the recipe to `TypeParameterCheck` and update its implementation and tests in one change (ADR 15 resolves recipe names with `snake_case()`), then update the docs that name the recipe.
7 changes: 4 additions & 3 deletions docs/developer/architecture/position-consistency.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ the two sides can silently disagree, producing incorrect or corrupted output.
* `src/renaissance/syntax_tree/ast_rewriter.py` - derives the buffer a rewrite batch is applied to.
* `src/renaissance/common/rewriter.py` - splices replacement text into that buffer, in bytes.
* `src/renaissance/syntax_tree/ast_node.py` - `binary_file_content`, the root-owned buffer accessor.
* `src/renaissance/integrations/python/ast/rst_node.py`, `src/renaissance/integrations/python/ast/cst_node.py`
and `src/renaissance/integrations/python/ast/util.py` - the Python adapters and the line/column to
offset conversion they share.
* `src/renaissance/integrations/python/ast/rst_node.py` and `src/renaissance/integrations/python/ast/util.py` -
the RST adapter and its line/column to offset conversion.
* `src/renaissance/integrations/python/ast/cst_node.py` - the CST adapter, which converts libcst's line/column
positions to byte offsets itself.
* `src/renaissance/integrations/tree_sitter/lst.py` - the tree-sitter adapter.
* `src/renaissance/integrations/clang/clang_ast_node.py` and
`src/renaissance/integrations/clang/clang_json_ast_node.py` - the clang adapters.
Expand Down
38 changes: 36 additions & 2 deletions docs/developer/feature-test-map/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,47 @@ https://github.com/TNO/Renaissance.Py/blob/main/LICENSE
## 1. Pattern matching

- **Feature:** [Pattern matching](../../user/features/pattern-matching.md)
- **Suggested test modules:** `tests/matching/`
- **Test file(s):**
- `test/syntax_tree/test_match_finder.py`
- `test/syntax_tree/test_match_finder_multi_assignments.py`
- `test/syntax_tree/test_match_tree.py`
- `test/syntax_tree/test_match_dict.py`
- `test/syntax_tree/test_pattern_match.py`
- `test/syntax_tree/test_pattern_kind.py`
- `test/python/ast/test_python_matcher.py`
- `test/c_cpp/test_c_match_finder.py`
- **Code file(s):** `src/renaissance/syntax_tree/match_finder.py`, `src/renaissance/syntax_tree/pattern_kind.py`

## 2. Rewrite semantics

- **Feature:** [Rewrite semantics](../../user/features/rewrite-semantics.md)
- **Concepts:** [Rewrite semantics](../../user/concepts/rewrite-semantics.md)
- **Test modules:** [Rewrite semantics test module](../../developer/modules/rewrite-semantics.md)
- **BDD feature file:** `features/rewrite-semantics.feature`
- **BDD steps:** `features/steps/test-rewrite-semantics.py`
- **BDD steps:** `features/steps/test_rewrite_semantics.py`
- **Test file(s):**
- `test/common/test_rewriter.py`
- `test/syntax_tree/test_ast_rewriter.py`
- `test/syntax_tree/test_rewrite_semantics_properties.py`
- **Code files:** `src/renaissance/common/rewriter.py`, `src/renaissance/syntax_tree/ast_rewriter.py`

## 3. Type parameter modernization

- **Feature:** [Type parameter modernization](../../user/features/type-parameter-modernization.md)
- **Concepts:** [Rewrite semantics](../../user/concepts/rewrite-semantics.md)
- **Code modules:** [Refactoring recipes](../../developer/modules/recipes.md)
- **Test file(s):**
- `test/recipes/test_type_var_check.py`
- `test/recipes/test_type_var_check_convert.py`
- `test/recipes/test_type_var_check_localize.py`
- `test/recipes/test_type_var_check_orphaned.py`
- `test/recipes/test_type_var_check_properties.py`
- `test/recipes/test_type_var_domain.py`
- `test/recipes/test_step_runner.py`
- `test/recipes/test_python_refactoring.py`
- `test/utils/test_import_resolution.py`
- `test/rejuvenation/test_migration_type_recipes.py`
- **Code file(s):** `src/renaissance/recipes/type_var_check.py`, `src/renaissance/recipes/type_var_domain.py`,
`src/renaissance/recipes/step_runner.py`,
`src/renaissance/recipes/python_refactoring.py`,
`src/renaissance/utils/import_resolution.py`, `src/rejuvenation/migration-type-recipes.py`
3 changes: 3 additions & 0 deletions docs/developer/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ https://github.com/TNO/Renaissance.Py/blob/main/LICENSE
5. [Transformation modules](transformation.md)
6. [Observability modules](observability.md)
7. [Strategy modules](strategy.md)
8. [Rewrite semantics module](rewrite-semantics.md)
9. [Refactoring recipes](recipes.md)
10. [Rejected recipes](rejected-recipes.md)
7 changes: 6 additions & 1 deletion docs/developer/modules/parser-and-ast.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,16 @@ preserves comments and whitespace, or reparses source. Each adapter supplies
those behaviors individually. Reference and data-flow collections
(`references`, `referenced_by`) are also parser-specific because not every
parser can provide the same analysis. Keep the original parser node available
when callers need parser-specific data.
when callers need parser-specific data. The Python CST adapter resolves them
with libcst's scope analysis, which also finds names used inside string
annotations. An annotation or type hint written above a definition in the
same scope still refers to it, since it is evaluated lazily.

The native Python `ast.AST` adapter is a lightweight structural adapter and
does not preserve source trivia in the same way as the lossless Python RST/CST
adapters. Use the lossless adapter when source-preserving rewriting is needed.
`PythonRefactoring` parses with the RST adapter by default; pass
`node_class=PythonCstNode` to use the CST adapter instead.

## Classify nodes

Expand Down
Loading
Loading