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

Ban type comments in stubs #167

Merged
merged 8 commits into from
Feb 2, 2022
Merged

Conversation

AlexWaygood
Copy link
Collaborator

Fixes #33

@AlexWaygood AlexWaygood changed the title Comments Ban type comments in stubs Feb 1, 2022
@AlexWaygood
Copy link
Collaborator Author

This was what led me to open python/typeshed#7099, by the way — an early draft of this PR raised false positives for those commented-out classes.

@AlexWaygood AlexWaygood marked this pull request as draft February 1, 2022 19:02
@AlexWaygood AlexWaygood marked this pull request as ready for review February 1, 2022 19:14
Copy link
Collaborator

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks!


for match, next_match in zip_longest(error_codes, error_codes[1:]):
end_pos = len(line) if next_match is None else next_match.start()
message = line[match.end() : end_pos].strip()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this is needed to support nested "#" within errors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yup, you got it.

@JelleZijlstra JelleZijlstra merged commit 7557546 into PyCQA:master Feb 2, 2022
@AlexWaygood AlexWaygood deleted the comments branch February 2, 2022 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check that disallows type comments
2 participants