Skip to content

Check syntax errors in "# type: ignore[code]" comments #7460

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 11 commits into from
Sep 27, 2019

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Sep 4, 2019

No description provided.

@JukkaL JukkaL requested a review from ilevkivskyi September 4, 2019 15:15
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks, looks good! I have just one comment. Also I would propose to add a test that an empty tag doesn't turn into ignore-all, i.e. only name-defined is ignored with a trailing coma:

def f() -> None: ...
f(x)  # type: ignore [name-defined,]

x = y # type: int # type: ignored [foo]
[out]
main:1: error: syntax error in type comment 'int' [syntax]
main:2: error: syntax error in type comment 'int' [syntax]
Copy link
Member

Choose a reason for hiding this comment

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

TBH this error is confusing. Is it hard to fix this?

@ilevkivskyi
Copy link
Member

Also wow, you just segfaulted gcc, we should probably report a bug.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Sep 27, 2019

It's not clear if the gcc segfault is reproducible. It happened in code that I didn't touch in this PR.

@JukkaL JukkaL merged commit 322e94e into master Sep 27, 2019
@JelleZijlstra JelleZijlstra deleted the errcode-check-syntax branch September 30, 2019 09:41
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy