Skip to content
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

Merged
merged 7 commits into from
Jan 30, 2025
Merged

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Nov 8, 2024

(based on #339, so merge that one first) Done

I added PYI to Ruff's select. https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
Ignored PYI021 to deal with it in its own PR
Then 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.

pyproject.toml Outdated Show resolved Hide resolved
@Avasam Avasam force-pushed the apply-flake8-pyi-autofixes branch 3 times, most recently from 75fc33c to 4f2c818 Compare November 10, 2024 19:40
@Avasam Avasam marked this pull request as ready for review November 10, 2024 19:40
@Avasam Avasam force-pushed the apply-flake8-pyi-autofixes branch 4 times, most recently from 9f58676 to 43de54a Compare November 22, 2024 19:07
pyproject.toml Outdated
Comment on lines 45 to 57
# 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
Copy link
Contributor Author

@Avasam Avasam Nov 22, 2024

@Avasam Avasam force-pushed the apply-flake8-pyi-autofixes branch from 258163f to f5a01ef Compare January 29, 2025 00:13
Copy link
Contributor

@debonte debonte left a 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.

@@ -17,7 +17,7 @@ class TransformNode:
pass_through = ...
def __init__(self, shorthand_name: str = ...) -> None: ...
if DEBUG:
def __str__(self) -> str: ...
pass
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@Avasam Avasam requested a review from debonte January 30, 2025 02:28
@debonte debonte merged commit 5ef1657 into microsoft:main Jan 30, 2025
3 checks passed
@Avasam Avasam deleted the apply-flake8-pyi-autofixes branch January 30, 2025 03:54
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