Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions STRUCTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ example-name/
├── README.md # Documentation and usage examples
├── run.py # Main implementation
├── guide.md # (Optional) Additional technical details
└── repo-before/ # (Optional) Sample code for transformation
└── input_repo/ # (Optional) Sample code for transformation
```

## Code Organization in `run.py`
Expand All @@ -43,7 +43,7 @@ Your `run.py` should follow this structure, demonstrated well in the `generate_t
@codegen.function("your-function-name")
def run(codebase: Codebase):
"""Clear docstring explaining what the function does.

Include:
1. Purpose of the function
2. Key steps or transformations
Expand Down Expand Up @@ -128,7 +128,7 @@ def get_function_context(function) -> dict:
@codegen.function("generate-training-data")
def run(codebase: Codebase):
"""Generate training data using a node2vec-like approach...

This codemod:
1. Finds all functions...
2. For each function...
Expand Down
3 changes: 1 addition & 2 deletions examples/flask_to_fastapi_migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ The script will process all Python files in the `repo-before` directory and appl
## Understanding the Code

- `run.py` - The migration script
- `repo-before/` - Sample Flask application to migrate
- `guide.md` - Additional notes and explanations
- `input_repo/` - Sample Flask application to migrate

## Learn More

Expand Down
3 changes: 1 addition & 2 deletions examples/python2_to_python3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ The script will process all Python files in the `repo-before` directory and appl
## Understanding the Code

- `run.py` - The migration script
- `repo-before/` - Sample Python 2 code to migrate
- `guide.md` - Additional notes and explanations
- `input_repo/` - Sample Python 2 code to migrate

## Learn More

Expand Down
17 changes: 2 additions & 15 deletions examples/sqlalchemy_1.6_to_2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,10 @@ The migration script handles four key transformations:
addresses: Mapped[List["Address"]] = relationship()
```

## Running the Example

```bash
# Install Codegen
pip install codegen

# Run the migration
python run.py
```

The script will process all Python files in the `repo-before` directory and apply the transformations in the correct order.

## Understanding the Code

- `run.py` - The migration script
- `repo-before/` - Sample SQLAlchemy 1.6 application to migrate
- `guide.md` - Additional notes and explanations
- `input_repo` - Sample SQLAlchemy 1.6 application to migrate
- `output_repo` - Sample SQLAlchemy 2.0 application after migration

## Learn More

Expand Down
96 changes: 0 additions & 96 deletions examples/sqlalchemy_1.6_to_2.0/guide.md

This file was deleted.

3 changes: 1 addition & 2 deletions examples/unittest_to_pytest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ The script will process all Python test files in the `repo-before` directory and
## Understanding the Code

- `run.py` - The migration script
- `repo-before/` - Sample `unittest` test suite to migrate
- `guide.md` - Additional notes and explanations
- `input_repo/` - Sample `unittest` test suite to migrate

## Learn More

Expand Down