Skip to content

Fix a few invalid noqa comments - #11497

Merged
JelleZijlstra merged 2 commits into
python:mainfrom
Avasam:noqa-comments-fixes
Feb 29, 2024
Merged

Fix a few invalid noqa comments#11497
JelleZijlstra merged 2 commits into
python:mainfrom
Avasam:noqa-comments-fixes

Conversation

@Avasam

Copy link
Copy Markdown
Collaborator

Extracted from #11496

@github-actions

This comment has been minimized.

@JelleZijlstraJelleZijlstra left a comment

Copy link
Copy Markdown
Member

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

Comment threadstubs/WebOb/webob/exc.pyi Outdated
@@ -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
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@AvasamAvasamFeb 29, 2024

Copy link
Copy Markdown
CollaboratorAuthor

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
Copy Markdown
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.

@AvasamAvasamFeb 29, 2024

Copy link
Copy Markdown
CollaboratorAuthor

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure!

Comment threadstubs/WebOb/webob/exc.pyi Outdated
@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
Copy Markdown
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

@github-actions

Copy link
Copy Markdown
Contributor

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

@JelleZijlstra
JelleZijlstra merged commit c75ecf0 into python:mainFeb 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 freeto 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

@Avasam@JelleZijlstra