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 ProtectedMethod pattern #548

Merged
merged 12 commits into from
Jul 22, 2020
Merged

Refactored ProtectedMethod pattern #548

merged 12 commits into from
Jul 22, 2020

Conversation

Vitaly-Protasov
Copy link
Collaborator

Solved in case of #528

acheshkov
acheshkov previously approved these changes Jul 21, 2020
@acheshkov
Copy link
Member

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 21, 2020

@rultor merge

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

@rultor
Copy link
Collaborator

rultor commented Jul 21, 2020

@rultor merge

@Vitaly-Protasov @acheshkov Oops, I failed. You can see the full log here (spent 2min)

+ cd ..
+ cat
+ '[' false = true ']'
+ cat
+ chmod a+x entry.sh
+ cat
+ echo 'export '\''head=git@github.com:cqfn/aibolit.git'\''' ';' 'export '\''pull_id=548'\''' ';' 'export '\''fork=git@github.com:cqfn/aibolit.git'\''' ';' 'export '\''fork_branch=issue_528_11'\''' ';' 'export '\''head_branch=master'\''' ';' 'export '\''pull_title=Refactored ProtectedMethod pattern'\''' ';' 'export '\''author=acheshkov'\''' ';' 'python3 -m pip install twine' ';' make ';'
+ sensitive=()
+ rm -rf .gpg
+ cd repo
+ git remote add fork git@github.com:cqfn/aibolit.git
+ git remote update
Fetching origin
Fetching fork
From github.com:cqfn/aibolit
 * [new branch]      acheshkov-patch-1 -> fork/acheshkov-patch-1
 * [new branch]      acheshkov-scope-update -> fork/acheshkov-scope-update
 * [new branch]      issue-295  -> fork/issue-295
 * [new branch]      issue-310  -> fork/issue-310
 * [new branch]      issue-404  -> fork/issue-404
 * [new branch]      issue-418  -> fork/issue-418
 * [new branch]      issue-419  -> fork/issue-419
 * [new branch]      issue-533  -> fork/issue-533
 * [new branch]      issue-550  -> fork/issue-550
 * [new branch]      issue_528_1 -> fork/issue_528_1
 * [new branch]      issue_528_10 -> fork/issue_528_10
 * [new branch]      issue_528_11 -> fork/issue_528_11
 * [new branch]      issue_528_12 -> fork/issue_528_12
 * [new branch]      issue_528_18 -> fork/issue_528_18
 * [new branch]      issue_528_3 -> fork/issue_528_3
 * [new branch]      issue_528_7 -> fork/issue_528_7
 * [new branch]      java_files_custom_dir -> fork/java_files_custom_dir
 * [new branch]      master     -> fork/master
 * [new branch]      taks-258   -> fork/taks-258
 * [new branch]      task-258   -> fork/task-258
 * [new branch]      upstream/java_files_custom_dir -> fork/upstream/java_files_custom_dir
+ args=
+ '[' default == default ']'
+ args=' --ff'
+ '[' default == no ']'
+ '[' default == only ']'
+ export BRANCH=__rultor
+ BRANCH=__rultor
++ wc -l
++ git show-branch __rultor
+ '[' 0 -gt 0 ']'
+ git checkout -B __rultor fork/issue_528_11
Switched to a new branch '__rultor'
Branch __rultor set up to track remote branch issue_528_11 from fork.
+ git checkout -B master origin/master
Switched to and reset branch 'master'
Branch master set up to track remote branch master from origin.
Your branch is up-to-date with 'origin/master'.
+ '[' false == true ']'
+ '[' false == true ']'
+ git merge --ff __rultor
Auto-merging aibolit/patterns/protected_method/protected_method.py
CONFLICT (content): Merge conflict in aibolit/patterns/protected_method/protected_method.py
Automatic merge failed; fix conflicts and then commit the result.
'cid' file is absent, container wasn't started correctly

Once we find a protected method in a class, it's a pattern.
'''
def _check_protected(self, node: ASTNode) -> bool:
if all(type in node.modifiers for type in ['protected']):
Copy link
Contributor

Choose a reason for hiding this comment

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

You can simply return result of all.

Copy link
Contributor

Choose a reason for hiding this comment

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

It seams like you simply looking if 'protected' is in modifiers. You may check it directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aravij What do you mean by checking it directly?

Copy link
Contributor

Choose a reason for hiding this comment

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

something like this

return 'protected' in node.modifiers

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it

@acheshkov
Copy link
Member

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 21, 2020

@rultor merge

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

@rultor
Copy link
Collaborator

rultor commented Jul 21, 2020

@rultor merge

@Vitaly-Protasov @acheshkov Oops, I failed. You can see the full log here (spent 2min)

+ '[' -z 'export '\''head=git@github.com:cqfn/aibolit.git'\''' ']'
+ cd ..
+ cat
+ '[' false = true ']'
+ cat
+ chmod a+x entry.sh
+ cat
+ echo 'export '\''head=git@github.com:cqfn/aibolit.git'\''' ';' 'export '\''pull_id=548'\''' ';' 'export '\''fork=git@github.com:cqfn/aibolit.git'\''' ';' 'export '\''fork_branch=issue_528_11'\''' ';' 'export '\''head_branch=master'\''' ';' 'export '\''pull_title=Refactored ProtectedMethod pattern'\''' ';' 'export '\''author=acheshkov'\''' ';' 'python3 -m pip install twine' ';' make ';'
+ sensitive=()
+ rm -rf .gpg
+ cd repo
+ git remote add fork git@github.com:cqfn/aibolit.git
+ git remote update
Fetching origin
Fetching fork
From github.com:cqfn/aibolit
 * [new branch]      acheshkov-patch-1 -> fork/acheshkov-patch-1
 * [new branch]      acheshkov-scope-update -> fork/acheshkov-scope-update
 * [new branch]      issue-295  -> fork/issue-295
 * [new branch]      issue-310  -> fork/issue-310
 * [new branch]      issue-404  -> fork/issue-404
 * [new branch]      issue-418  -> fork/issue-418
 * [new branch]      issue-419  -> fork/issue-419
 * [new branch]      issue-533  -> fork/issue-533
 * [new branch]      issue-550  -> fork/issue-550
 * [new branch]      issue_528_1 -> fork/issue_528_1
 * [new branch]      issue_528_10 -> fork/issue_528_10
 * [new branch]      issue_528_11 -> fork/issue_528_11
 * [new branch]      issue_528_18 -> fork/issue_528_18
 * [new branch]      issue_528_3 -> fork/issue_528_3
 * [new branch]      issue_528_7 -> fork/issue_528_7
 * [new branch]      java_files_custom_dir -> fork/java_files_custom_dir
 * [new branch]      master     -> fork/master
 * [new branch]      taks-258   -> fork/taks-258
 * [new branch]      task-258   -> fork/task-258
 * [new branch]      upstream/java_files_custom_dir -> fork/upstream/java_files_custom_dir
+ args=
+ '[' default == default ']'
+ args=' --ff'
+ '[' default == no ']'
+ '[' default == only ']'
+ export BRANCH=__rultor
+ BRANCH=__rultor
++ wc -l
++ git show-branch __rultor
+ '[' 0 -gt 0 ']'
+ git checkout -B __rultor fork/issue_528_11
Switched to a new branch '__rultor'
Branch __rultor set up to track remote branch issue_528_11 from fork.
+ git checkout -B master origin/master
Switched to and reset branch 'master'
Branch master set up to track remote branch master from origin.
Your branch is up-to-date with 'origin/master'.
+ '[' false == true ']'
+ '[' false == true ']'
+ git merge --ff __rultor
Auto-merging aibolit/patterns/protected_method/protected_method.py
CONFLICT (content): Merge conflict in aibolit/patterns/protected_method/protected_method.py
Automatic merge failed; fix conflicts and then commit the result.
'cid' file is absent, container wasn't started correctly

aravij
aravij previously approved these changes Jul 22, 2020
@acheshkov
Copy link
Member

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 22, 2020

@rultor merge

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

@rultor
Copy link
Collaborator

rultor commented Jul 22, 2020

@rultor merge

@Vitaly-Protasov @acheshkov Oops, I failed. You can see the full log here (spent 2min)

+ cd ..
+ cat
+ '[' false = true ']'
+ cat
+ chmod a+x entry.sh
+ cat
+ echo 'export '\''head=git@github.com:cqfn/aibolit.git'\''' ';' 'export '\''pull_id=548'\''' ';' 'export '\''fork=git@github.com:cqfn/aibolit.git'\''' ';' 'export '\''fork_branch=issue_528_11'\''' ';' 'export '\''head_branch=master'\''' ';' 'export '\''pull_title=Refactored ProtectedMethod pattern'\''' ';' 'export '\''author=acheshkov'\''' ';' 'python3 -m pip install twine' ';' make ';'
+ sensitive=()
+ rm -rf .gpg
+ cd repo
+ git remote add fork git@github.com:cqfn/aibolit.git
+ git remote update
Fetching origin
Fetching fork
From github.com:cqfn/aibolit
 * [new branch]      acheshkov-patch-1 -> fork/acheshkov-patch-1
 * [new branch]      acheshkov-scope-update -> fork/acheshkov-scope-update
 * [new branch]      issue-295  -> fork/issue-295
 * [new branch]      issue-310  -> fork/issue-310
 * [new branch]      issue-404  -> fork/issue-404
 * [new branch]      issue-418  -> fork/issue-418
 * [new branch]      issue-419  -> fork/issue-419
 * [new branch]      issue-533  -> fork/issue-533
 * [new branch]      issue-550  -> fork/issue-550
 * [new branch]      issue_528_1 -> fork/issue_528_1
 * [new branch]      issue_528_10 -> fork/issue_528_10
 * [new branch]      issue_528_11 -> fork/issue_528_11
 * [new branch]      issue_528_18 -> fork/issue_528_18
 * [new branch]      issue_528_3 -> fork/issue_528_3
 * [new branch]      issue_528_7 -> fork/issue_528_7
 * [new branch]      issue_528_8 -> fork/issue_528_8
 * [new branch]      java_files_custom_dir -> fork/java_files_custom_dir
 * [new branch]      master     -> fork/master
 * [new branch]      taks-258   -> fork/taks-258
 * [new branch]      task-258   -> fork/task-258
 * [new branch]      upstream/java_files_custom_dir -> fork/upstream/java_files_custom_dir
+ args=
+ '[' default == default ']'
+ args=' --ff'
+ '[' default == no ']'
+ '[' default == only ']'
+ export BRANCH=__rultor
+ BRANCH=__rultor
++ git show-branch __rultor
++ wc -l
+ '[' 0 -gt 0 ']'
+ git checkout -B __rultor fork/issue_528_11
Switched to a new branch '__rultor'
Branch __rultor set up to track remote branch issue_528_11 from fork.
+ git checkout -B master origin/master
Switched to and reset branch 'master'
Branch master set up to track remote branch master from origin.
Your branch is up-to-date with 'origin/master'.
+ '[' false == true ']'
+ '[' false == true ']'
+ git merge --ff __rultor
Auto-merging aibolit/patterns/protected_method/protected_method.py
CONFLICT (content): Merge conflict in aibolit/patterns/protected_method/protected_method.py
Automatic merge failed; fix conflicts and then commit the result.
'cid' file is absent, container wasn't started correctly

@acheshkov
Copy link
Member

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Jul 22, 2020

@rultor merge

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

@rultor rultor merged commit 8a7a039 into master Jul 22, 2020
@rultor
Copy link
Collaborator

rultor commented Jul 22, 2020

@rultor merge

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

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