Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

πŸ”„ Update Unicode to String#22

Draft
codegen-sh[bot] wants to merge 1 commit into
mainfrom
codegen-epic-5795-task-94251-solve-30653
Draft

πŸ”„ Update Unicode to String#22
codegen-sh[bot] wants to merge 1 commit into
mainfrom
codegen-epic-5795-task-94251-solve-30653

Conversation

@codegen-sh
Copy link
Copy Markdown

@codegen-sh codegen-sh Bot commented Oct 28, 2024

πŸ€– Codegen-erated PR

πŸ›  View and Edit the Codemod

You can view and edit the codemod at codegen.sh ✍️

Click to view the codemod code
# Iterate through all files in the codebase
for file in codebase.files:

    # Skip alembic files
    if 'app/alembic/' not in file.filepath:
        print(f"πŸ”Ž Lookin into file {file.file_path}")
    
        # for each import in the file
        for imp in file.imports:
            # if the name of the import is `Unicode`
            if imp.name == 'Unicode':
                print(f"πŸ”΅ Updating import statement")
                # set the name of the import to `String`
                imp.set_name("String")

        # for each function call in the file
        for func_call in file.function_calls:
            # if the function call is a call to "Unicode"
            if func_call.name == "Unicode":
                print(f"🟠 Updating function call")
                # set the name of the function call to `String`
                func_call.set_name("String")

            # for each argument in the function call
            for arg in func_call.args:
                # if the value of the argument is `Unicode`
                if arg.value == "Unicode":
                    print(f"🟑 Updating argument")
                    # set the value of the argument to `String`
                    arg.set_value("String")

        print(f"βœ… Finished refactoring {file.file_path} \n")

FAQ

✨ Click to expand
  • ❓ What if this PR has errors?

    • If this PR was created from a GPT chat, you can post the error in the chat and the agent will try to resolve it for you πŸ™. Or you can post the error in our slack channel 🀝!
  • ❓ Should I merge this PR or does Codegen?

    • Codegen does not merge PRs. It's up to you to review the changes and merge the PR when you're ready πŸŽ‰. This allows internal engineers to control when/if the changes merge into master πŸ™‡.
  • ❓ What if I want to talk to a human about this PR?

Codegen β€’ What is Codegen?

Codegen allows you to programmatically analyze and manipulate your codebase.

Learn more or come say hey πŸ‘‹ in our slack channel - we'd love to hear your ideas for what Codegen should do next 🀩!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants