Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to identify when a method is renamed. #290

Open
ricardojob opened this issue Nov 29, 2023 · 0 comments
Open

How to identify when a method is renamed. #290

ricardojob opened this issue Nov 29, 2023 · 0 comments

Comments

@ricardojob
Copy link

I often need to identify when a method is renamed.

For example, in the following codes, we have two versions of the Sample class.

#version 1        
class Sample:
    def m3(self):
        print("any")

We can see that there were two changes to this commit.
On line 3, print("added") was added and, on line 2, the m3 method was renamed to m5.

#version 2         
class Sample:
    def m5(self):
        print("added")
        print("any")

When we iterate over the commits, we can use the changed_methods method (class ModifiedFile) to identify the list of methods that were changed.
However, in the previous code snippets the m5 method is identified as a new method.

Is there a way to identify that the method has been renamed?

@ricardojob ricardojob changed the title How identify when a method is renamed. How to identify when a method is renamed. Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant