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

[flake8-pyi] Add autofix for unused-private-type-var (PYI018) #15999

Merged

Conversation

ayushbaweja
Copy link
Contributor

Resolves #15940

Summary

This pull request adds an autofix for the flake8-pyi rule PYI018 (Unused private type variable). Currently, Ruff detects and reports unused private type variables, but it doesn't offer a way to automatically remove them. This change addresses this by providing an autofix that deletes the unused type variable definition.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks, this looks great!

@AlexWaygood AlexWaygood added the fixes Related to suggested fixes for violations label Feb 6, 2025
Copy link
Contributor

github-actions bot commented Feb 6, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thank you! I'll push a few small fixups and then land 👍

@AlexWaygood AlexWaygood added the preview Related to preview mode features label Feb 6, 2025
@AlexWaygood AlexWaygood merged commit ba2f0e9 into astral-sh:main Feb 6, 2025
21 checks passed
@ayushbaweja ayushbaweja deleted the fix-pyi018-unused-private-type-var branch February 6, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixes Related to suggested fixes for violations preview Related to preview mode features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[flake8-pyi] Add autofix for unused-private-type-var (PYI018)
2 participants