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

refactored method_siblings #542

Merged
merged 7 commits into from
Jul 23, 2020
Merged

refactored method_siblings #542

merged 7 commits into from
Jul 23, 2020

Conversation

Vitaly-Protasov
Copy link
Collaborator

In case of #528

@aravij aravij added this to the AST framework milestone Jul 20, 2020
aibolit/patterns/method_siblings/method_siblings.py Outdated Show resolved Hide resolved
aibolit/patterns/method_siblings/method_siblings.py Outdated Show resolved Hide resolved
aibolit/patterns/method_siblings/method_siblings.py Outdated Show resolved Hide resolved
aibolit/patterns/method_siblings/method_siblings.py Outdated Show resolved Hide resolved
aibolit/patterns/method_siblings/method_siblings.py Outdated Show resolved Hide resolved
aravij
aravij previously approved these changes Jul 22, 2020
aibolit/patterns/method_siblings/method_siblings.py Outdated Show resolved Hide resolved
start with the same names
'''
def _is_method_names_close(self, node: ASTNode, new_node: ASTNode) -> bool:
node_name = re.split('([A-Z][^A-Z]*)', node.name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better use [0] right here, it will allow to give better name to node_name. Maybe something like this

Suggested change
node_name = re.split('([A-Z][^A-Z]*)', node.name)
common_prefix = re.split('([A-Z][^A-Z]*)', node.name)[0]

And change the next line accordingly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately i cant change it, because, after that I check len(node_name) > 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we better pick up a different name.

@acheshkov
Copy link
Member

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 23, 2020

@rultor merge

@acheshkov OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 8cbd91f into master Jul 23, 2020
@rultor
Copy link
Collaborator

rultor commented Jul 23, 2020

@rultor merge

@acheshkov Done! FYI, the full log is here (took me 18min)

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

Successfully merging this pull request may close these issues.

4 participants