-
Notifications
You must be signed in to change notification settings - Fork 101
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
Apply flake8-pyi autofixes #340
Conversation
75fc33c
to
4f2c818
Compare
9f58676
to
43de54a
Compare
pyproject.toml
Outdated
# TODO: Handle in its own PR | ||
"PYI021", # https://github.com/microsoft/python-type-stubs/pull/343 | ||
|
||
# TODO: Investigate and fix or configure | ||
"PYI001", | ||
"PYI002", | ||
"PYI017", | ||
"PYI019", # Request for more autofixes: https://github.com/astral-sh/ruff/issues/14183 | ||
"PYI024", | ||
"PYI048", | ||
"PYI051", # Request for autofix: https://github.com/astral-sh/ruff/issues/14185 | ||
"PYI052", | ||
"PYI061", # Request for more autofixes: https://github.com/astral-sh/ruff/issues/14537 |
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.
Updated references for Ruff 0.9.3:
- Request: Unsafe fix for
custom-type-var-return-type
/PYI019
astral-sh/ruff#14183 - Request: Autofix for
redundant-numeric-union
/PYI041
&redundant-literal-union
/PYI051
astral-sh/ruff#14185 - Request: More autofixes for
redundant-none-literal
/PYI061
astral-sh/ruff#14537 redundant-none-literal (PYI061)
: Unsafe or different autofix for Python 3.9 astral-sh/ruff#15795- Request: More unsafe fixes for
custom-type-var-return-type
/PYI019
astral-sh/ruff#15798
PYI021 is also done separately in #343
bab076c
to
258163f
Compare
258163f
to
f5a01ef
Compare
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.
Sorry for the delay. I've been off work for a couple months for medical reasons. I'll try to get these PRs all reviewed over the next 2-3 days.
stubs/matplotlib/transforms.pyi
Outdated
@@ -17,7 +17,7 @@ class TransformNode: | |||
pass_through = ... | |||
def __init__(self, shorthand_name: str = ...) -> None: ... | |||
if DEBUG: | |||
def __str__(self) -> str: ... | |||
pass |
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.
Maybe remove the if DEBUG:
block entirely?
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.
Funnily enough, that's also done in #352 , but yeah I'll remove the condition entirely.
I've been off work for a couple months for medical reasons
I hope you're doing alright now! Good to have you back.
(based on #339, so merge that one first)DoneI added
PYI
to Ruff'sselect
. https://docs.astral.sh/ruff/rules/#flake8-pyi-pyiIgnored
PYI021
to deal with it in its own PRThen run
ruff check --fix --preview
:Found 1700 errors (1074 fixed, 626 remaining).
Then ignore the checks still failing to keep this PR to automated fixes only. (because Ruff has no config to set as warning: astral-sh/ruff#1256)
Note that
flake8-future-annotations (FA)
was already passing on main, so I just included it.