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

tests: Remove unused import statements #1143

Merged
merged 1 commit into from
Dec 17, 2016
Merged

Conversation

Techievena
Copy link
Member

Remove the unused imports in tests directory,
to help prepare for coala/coala#3066

Fixes #1126

@gitmate-bot
Copy link
Collaborator

Thanks for your contribution!

Reviewing pull requests take really a lot of time and we're all volunteers. Please make sure you go through the following check list and complete them all before pinging someone for a review.

As you learn things over your Pull Request please help others on the chat and on PRs to get their stuff right as well!

@jayvdb
Copy link
Member

jayvdb commented Dec 16, 2016

Do not use the GitHub rebase feature. See https://github.com/coala/coala-bears/pull/1143/commits
Please rebase properly. Come onto Gitter for help fixing your branch.

@@ -1,5 +1,4 @@
import sys
import platform # Unused import
Copy link
Member

Choose a reason for hiding this comment

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

I think everything in tests/python/test_files/ shouldnt be modified - they are intentionally bad syntax

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry @jayvdb I am unable to figure out what changes I have to make in this

Copy link
Member

Choose a reason for hiding this comment

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

Restore this line as it was. We'll find a solution for this line in coala/coala#3066 , after your patch is merged.

Copy link
Member

Choose a reason for hiding this comment

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

You havent restored this line exactly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry I'd do that I thought It'd be same if I rewrite the line

@@ -6,13 +6,6 @@
from tests.BearTestHelper import generate_skip_decorator
from tests.LocalBearTestHelper import verify_local_bear

try:
Copy link
Member

Choose a reason for hiding this comment

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

this small block needs to stay here. See the voodoo in https://github.com/coala/coala-bears/pull/1135/files to work around this problem.

ie. use

    import language_check
    import guess_language
    language_check
    guess_language

Copy link
Member

@jayvdb jayvdb left a comment

Choose a reason for hiding this comment

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

rebase (interactive) your commits please

@@ -9,10 +9,11 @@
try:
import language_check
import guess_language
language_check
Copy link
Member

Choose a reason for hiding this comment

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

you had to remove these right? not just the import keyword but everything?

Copy link
Member

Choose a reason for hiding this comment

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

@jayvdb are we sure we want to remove these? it looks like the bear uses these to determine wether to skip the test?

Copy link
Member

@Mixih Mixih Dec 17, 2016

Choose a reason for hiding this comment

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

it's the hacky solution mentioned in this pull: #1135. This makes coala issue #1000 rather important for future dev.

Copy link
Member

Choose a reason for hiding this comment

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

use a coala ignore statement here?

Copy link
Member

Choose a reason for hiding this comment

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

this approach adds two lines, and works with pyflakes natively.
your solution adds or amends two lines, and only works within coala.
I'm not seeing the benefit, especially not work holding up this patch and potentially conflicting with other patches incoming. If necessary we can switch later.

@abh3po
Copy link
Member

abh3po commented Dec 17, 2016

@Techievena you didnt remove this: tests/python/test_files/pylint_test.py:2: 'platform' imported but unused

@Techievena
Copy link
Member Author

@abhsag24 I didn't remove [tests/python/test_files/pylint_test.py:2: 'platform' imported but unused] as @jayvdb commented it as a bad syntax and it will be handled in a different issue. So he asked me to restore it.

@sils
Copy link
Member

sils commented Dec 17, 2016

@jayvdb what about eceeb35#r92918230 ?

@jayvdb
Copy link
Member

jayvdb commented Dec 17, 2016

ack eceeb35

@jayvdb
Copy link
Member

jayvdb commented Dec 17, 2016

I think it needs a rebase, but I cant verify that easily atm

@sils
Copy link
Member

sils commented Dec 17, 2016 via email

@Techievena
Copy link
Member Author

Do I have to modify this pull request??? (Rebase it????)

@jayvdb
Copy link
Member

jayvdb commented Dec 17, 2016

Yup. rebase it pls

Remove the unused imports in tests directory,
to help prepare for coala/coala#3066

Fixes coala#1126
@sils
Copy link
Member

sils commented Dec 17, 2016

ack ff17210

@sils
Copy link
Member

sils commented Dec 17, 2016

@rultor merge

@sils
Copy link
Member

sils commented Dec 17, 2016

@Techievena @jayvdb is there any bear we can activate to prevent this from happening in the future?

@rultor
Copy link

rultor commented Dec 17, 2016

@rultor merge

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

@rultor rultor merged commit ff17210 into coala:master Dec 17, 2016
@rultor
Copy link

rultor commented Dec 17, 2016

@rultor merge

@sils Done! FYI, the full log is here (took me 1min)

@Techievena Techievena deleted the issue#1126 branch December 17, 2016 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

7 participants