Skip to content

Fix a few invalid noqa comments #11497

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
Feb 29, 2024
Merged

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Feb 29, 2024

Extracted from #11496

This comment has been minimized.

Copy link
Member

@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, suggested two other changes while we're here

@@ -41,7 +41,7 @@ class WSGIHTTPException(Response, HTTPException):
def generate_response(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
@property
def wsgi_response(self) -> Self: ... # type:ignore[override]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def wsgi_response(self) -> Self: ... # type:ignore[override]
def wsgi_response(self) -> Self: ... # type: ignore[override]

Copy link
Collaborator Author

@Avasam Avasam Feb 29, 2024

Choose a reason for hiding this comment

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

I've seen (and done) that often. Idk if it's just outside a formatter's purview (Ruff formatter/black). Maybe Ruff linting and/or flake8-pyi could check for this stylistic issue.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, this could be a good lint rule.

Copy link
Collaborator Author

@Avasam Avasam Feb 29, 2024

Choose a reason for hiding this comment

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

There's 40 instances of type:ignore in the code. I could fix them all at once here if you'd like. It's not too far off the original scope of this PR anyway

Copy link
Member

Choose a reason for hiding this comment

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

Sure!

@@ -41,7 +41,7 @@ class WSGIHTTPException(Response, HTTPException):
def generate_response(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...
@property
def wsgi_response(self) -> Self: ... # type:ignore[override]
def __str__(self) -> str: ... # type:ignore[override] # noqaY029
def __str__(self) -> str: ... # type:ignore[override] # noqa: Y029
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def __str__(self) -> str: ... # type:ignore[override] # noqa: Y029
def __str__(self) -> str: ... # type: ignore[override] # noqa: Y029

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit c75ecf0 into python:main Feb 29, 2024
@Avasam Avasam deleted the noqa-comments-fixes branch February 29, 2024 07:09
danieleades pushed a commit to danieleades/typeshed that referenced this pull request Mar 1, 2024
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