-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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
stubs/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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def wsgi_response(self) -> Self: ... # type:ignore[override] | |
def wsgi_response(self) -> Self: ... # type: ignore[override] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
stubs/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] | |||
def __str__(self) -> str: ... # type:ignore[override] # noqaY029 | |||
def __str__(self) -> str: ... # type:ignore[override] # noqa: Y029 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __str__(self) -> str: ... # type:ignore[override] # noqa: Y029 | |
def __str__(self) -> str: ... # type: ignore[override] # noqa: Y029 |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Extracted from #11496