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

Inline method Improvement #54

Merged
merged 40 commits into from
Oct 21, 2020
Merged

Inline method Improvement #54

merged 40 commits into from
Oct 21, 2020

Conversation

Vitaly-Protasov
Copy link
Contributor

Fixed in #50

@Vitaly-Protasov Vitaly-Protasov marked this pull request as draft October 12, 2020 22:06
@lyriccoder
Copy link
Member

lyriccoder commented Oct 13, 2020

Could you please add test for each fixed bug?

@Vitaly-Protasov Vitaly-Protasov changed the title fixed some bugs Inline method Improvement Oct 13, 2020
@Vitaly-Protasov
Copy link
Contributor Author

Could you please add test for each fixed bug?

sure I will

original_func = dict_original_invocations.get(invocation_node.member)[0] # type: ignore
body_start_line, body_end_line = method_body_lines(original_func, file_path)
text_lines = read_text_with_autodetected_encoding(str(file_path)).split('\n')

line_to_csv = [
str(file_path),
file_path,
Copy link
Member

Choose a reason for hiding this comment

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

here must be a string, otherwise there will be dirty string like Path("A/b/A") instead of "A/b/A"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

У меня кстати не было такого

@@ -267,7 +264,7 @@ def insert_code_with_new_file_creation(
return line_to_csv


def analyze_file(file_path: Path, output_path: Path) -> List[Any]:
def _analyze_file(file_path: Path, output_path: Path) -> List[Any]:
Copy link
Member

Choose a reason for hiding this comment

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

why do u make _ before each function? It's not a private function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Я удалил потом



class InlineWithReturnWithoutArguments(IBaseInlineAlgorithm):

def __init__(self):
super().__init__()

def inline_function(
def get_lines_before_invocation(
Copy link
Member

Choose a reason for hiding this comment

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

You have the same function. I see, we have a code duplication, extract this default functionality to a protected method in the base abstract class

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Member

@lyriccoder lyriccoder left a comment

Choose a reason for hiding this comment

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

Fix

@Vitaly-Protasov Vitaly-Protasov marked this pull request as ready for review October 19, 2020 18:13
Copy link
Member

@lyriccoder lyriccoder left a comment

Choose a reason for hiding this comment

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

ok

@Vitaly-Protasov Vitaly-Protasov merged commit ca1b472 into master Oct 21, 2020
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.

2 participants