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

bad-version-info-comparison (PYI006) doesn't run in .py files #13836

Closed
Avasam opened this issue Oct 20, 2024 · 1 comment · Fixed by #14059
Closed

bad-version-info-comparison (PYI006) doesn't run in .py files #13836

Avasam opened this issue Oct 20, 2024 · 1 comment · Fixed by #14059
Labels
accepted Ready for implementation help wanted Contributions especially welcome rule Implementing or modifying a lint rule

Comments

@Avasam
Copy link
Contributor

Avasam commented Oct 20, 2024

This rule could've caught an issue in pywin32 (mhammond/pywin32#2416). I think it's a valid rule to enforce on runtime files to prevent incorrect expectations.

MRE:

if sys.version_info > (3, 10):  # PYI006 only shows here in .pyi files
    print("Do something on Python 3.11")

Command: ruff check --select=PYI
Version: ruff 0.7.0

@AlexWaygood
Copy link
Member

This makes sense to me.

@AlexWaygood AlexWaygood added the accepted Ready for implementation label Oct 20, 2024
@dhruvmanila dhruvmanila added rule Implementing or modifying a lint rule help wanted Contributions especially welcome labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation help wanted Contributions especially welcome rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants