Skip to content

Don't report unused type ignores in typeshed #1920

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

Merged
merged 2 commits into from
Jul 22, 2016

Conversation

ddfisher
Copy link
Collaborator

Fixes #1884.

Feels a bit hacky, though. Not entirely sure how I feel about it.

False, False)
self.error_info.append(info)

def is_typeshed_file(self, file):
Copy link
Member

Choose a reason for hiding this comment

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

This function needs annotations.

If you make this the accepted, public interface to determine whether a file is in the typeshed or not, you can refactor the code in checker.py that sets is_typeshed_stub there like this:

    self.is_typeshed_stub = self.errors.is_typeshed_file(path)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a nice improvement. Fixed!

@gvanrossum gvanrossum merged commit 647954c into master Jul 22, 2016
@gvanrossum gvanrossum deleted the warn-unused-ignores-typeshed branch July 27, 2016 05:00
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