From 78e37029fe5f76b81dc88498387b7761e82b59a8 Mon Sep 17 00:00:00 2001 From: Vishal Shenoy Date: Wed, 29 Jan 2025 14:18:24 -0800 Subject: [PATCH 1/7] . --- examples/dict_to_schema/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/dict_to_schema/README.md b/examples/dict_to_schema/README.md index 847b69f..d77db56 100644 --- a/examples/dict_to_schema/README.md +++ b/examples/dict_to_schema/README.md @@ -2,6 +2,9 @@ This example demonstrates how to automatically convert Python dictionary literals into Pydantic models. The codemod makes this process simple by handling all the tedious manual updates automatically. + +View example transformations created by this codemod on the `modal-labs/modal-client` repository [here](https://www.codegen.sh/codemod/6b5f2dfa-948a-4953-b283-9bd4b8545632/public/diff). + ## How the Conversion Script Works The script (`run.py`) automates the entire conversion process in a few key steps: From 5f427a526c54d3fe145ce01360a73001e8eb3dbd Mon Sep 17 00:00:00 2001 From: Vishal Shenoy Date: Wed, 29 Jan 2025 14:22:25 -0800 Subject: [PATCH 2/7] . --- examples/dict_to_schema/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dict_to_schema/README.md b/examples/dict_to_schema/README.md index d77db56..3f89bd6 100644 --- a/examples/dict_to_schema/README.md +++ b/examples/dict_to_schema/README.md @@ -2,8 +2,8 @@ This example demonstrates how to automatically convert Python dictionary literals into Pydantic models. The codemod makes this process simple by handling all the tedious manual updates automatically. +> **💡 View example transformations created by this codemod on the `modal-labs/modal-client` repository [here](https://www.codegen.sh/codemod/6b5f2dfa-948a-4953-b283-9bd4b8545632/public/diff).** -View example transformations created by this codemod on the `modal-labs/modal-client` repository [here](https://www.codegen.sh/codemod/6b5f2dfa-948a-4953-b283-9bd4b8545632/public/diff). ## How the Conversion Script Works From 8f113c78e4706761ec6d7a2c71099927bd52466c Mon Sep 17 00:00:00 2001 From: Vishal Shenoy Date: Wed, 29 Jan 2025 14:25:40 -0800 Subject: [PATCH 3/7] . --- examples/dict_to_schema/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dict_to_schema/README.md b/examples/dict_to_schema/README.md index 3f89bd6..222f189 100644 --- a/examples/dict_to_schema/README.md +++ b/examples/dict_to_schema/README.md @@ -2,8 +2,8 @@ This example demonstrates how to automatically convert Python dictionary literals into Pydantic models. The codemod makes this process simple by handling all the tedious manual updates automatically. -> **💡 View example transformations created by this codemod on the `modal-labs/modal-client` repository [here](https://www.codegen.sh/codemod/6b5f2dfa-948a-4953-b283-9bd4b8545632/public/diff).** - +> [!NOTE] +> View example transformations created by this codemod on the `modal-labs/modal-client` repository [here](https://www.codegen.sh/codemod/6b5f2dfa-948a-4953-b283-9bd4b8545632/public/diff). ## How the Conversion Script Works From f73324a47f132b66b12218b6dc5c5016578ddaba Mon Sep 17 00:00:00 2001 From: Vishal Shenoy Date: Wed, 29 Jan 2025 15:00:46 -0800 Subject: [PATCH 4/7] . --- examples/usesuspensequery_to_usesuspensequeries/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/usesuspensequery_to_usesuspensequeries/README.md b/examples/usesuspensequery_to_usesuspensequeries/README.md index 42497a8..f2c7d35 100644 --- a/examples/usesuspensequery_to_usesuspensequeries/README.md +++ b/examples/usesuspensequery_to_usesuspensequeries/README.md @@ -2,6 +2,9 @@ This example demonstrates how to use Codegen to automatically convert multiple `useSuspenseQuery` calls to a single `useSuspenseQueries` call in React codebases. The migration script makes this process simple by handling all the tedious manual updates automatically. +> [!NOTE] +> View example transformations created by this codemod on the `deepfence/ThreatMapper` repository [here](codegen.sh/codemod/a433152e-5e8d-4319-8043-19ff2b418869/public/diff). + ## How the Migration Script Works The script automates the entire migration process in a few key steps: From 5c435c7ba993c60c4ceaf8ed7510ca1ed65d8b92 Mon Sep 17 00:00:00 2001 From: codegen-bot Date: Wed, 29 Jan 2025 15:29:13 -0800 Subject: [PATCH 5/7] . --- examples/freezegun_to_timemachine_migration/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/freezegun_to_timemachine_migration/README.md b/examples/freezegun_to_timemachine_migration/README.md index c1155ec..459589e 100644 --- a/examples/freezegun_to_timemachine_migration/README.md +++ b/examples/freezegun_to_timemachine_migration/README.md @@ -1,4 +1,4 @@ - FreezeGun to TimeMachine Migration Example +# FreezeGun to TimeMachine Migration Example This example demonstrates how to use Codegen to automatically migrate test code from FreezeGun to TimeMachine for time mocking. The migration script makes this process simple by handling all the tedious manual updates automatically. From 5cab1dc072358ce23a95cabf21258e6fdd5e26bc Mon Sep 17 00:00:00 2001 From: Vishal Shenoy Date: Wed, 29 Jan 2025 17:14:20 -0800 Subject: [PATCH 6/7] . --- examples/usesuspensequery_to_usesuspensequeries/run.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/usesuspensequery_to_usesuspensequeries/run.py b/examples/usesuspensequery_to_usesuspensequeries/run.py index 09a7e69..020c291 100644 --- a/examples/usesuspensequery_to_usesuspensequeries/run.py +++ b/examples/usesuspensequery_to_usesuspensequeries/run.py @@ -76,6 +76,7 @@ def run(codebase: Codebase): print("\nModification complete:") print(f"Files modified: {files_modified}") print(f"Functions modified: {functions_modified}") + codebase.commit() if __name__ == "__main__": From 1f93057a7b956881060ab93ed79eb1381458f7ec Mon Sep 17 00:00:00 2001 From: vishalshenoy <34020235+vishalshenoy@users.noreply.github.com> Date: Thu, 30 Jan 2025 01:55:13 +0000 Subject: [PATCH 7/7] Automated pre-commit update --- examples/dict_to_schema/README.md | 2 +- examples/usesuspensequery_to_usesuspensequeries/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dict_to_schema/README.md b/examples/dict_to_schema/README.md index 222f189..7882e03 100644 --- a/examples/dict_to_schema/README.md +++ b/examples/dict_to_schema/README.md @@ -3,7 +3,7 @@ This example demonstrates how to automatically convert Python dictionary literals into Pydantic models. The codemod makes this process simple by handling all the tedious manual updates automatically. > [!NOTE] -> View example transformations created by this codemod on the `modal-labs/modal-client` repository [here](https://www.codegen.sh/codemod/6b5f2dfa-948a-4953-b283-9bd4b8545632/public/diff). +> View example transformations created by this codemod on the `modal-labs/modal-client` repository [here](https://www.codegen.sh/codemod/6b5f2dfa-948a-4953-b283-9bd4b8545632/public/diff). ## How the Conversion Script Works diff --git a/examples/usesuspensequery_to_usesuspensequeries/README.md b/examples/usesuspensequery_to_usesuspensequeries/README.md index f2c7d35..0ff7114 100644 --- a/examples/usesuspensequery_to_usesuspensequeries/README.md +++ b/examples/usesuspensequery_to_usesuspensequeries/README.md @@ -3,7 +3,7 @@ This example demonstrates how to use Codegen to automatically convert multiple `useSuspenseQuery` calls to a single `useSuspenseQueries` call in React codebases. The migration script makes this process simple by handling all the tedious manual updates automatically. > [!NOTE] -> View example transformations created by this codemod on the `deepfence/ThreatMapper` repository [here](codegen.sh/codemod/a433152e-5e8d-4319-8043-19ff2b418869/public/diff). +> View example transformations created by this codemod on the `deepfence/ThreatMapper` repository [here](codegen.sh/codemod/a433152e-5e8d-4319-8043-19ff2b418869/public/diff). ## How the Migration Script Works