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

[ruff] Skip type definitions for missing-f-string-syntax (RUF027) #16054

Merged
merged 3 commits into from
Feb 9, 2025

Conversation

dylwil3
Copy link
Collaborator

@dylwil3 dylwil3 commented Feb 9, 2025

As an f-string is never correct in a type definition context, we skip missing-f-string-syntax (RUF027) in this case.

Closes #16037

@dylwil3 dylwil3 added bug Something isn't working rule Implementing or modifying a lint rule preview Related to preview mode features labels Feb 9, 2025
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.

Excellent, thank you! We could consider adding an integration test in https://github.com/astral-sh/ruff/blob/main/crates/ruff/tests/lint.rs that runs TC006 in combination with RUF027 on this snippet. But it's probably not really necessary here

@dylwil3
Copy link
Collaborator Author

dylwil3 commented Feb 9, 2025

We could consider adding an integration test in https://github.com/astral-sh/ruff/blob/main/crates/ruff/tests/lint.rs that runs TC006 in combination with RUF027 on this snippet. But it's probably not really necessary here

Yeah, I think it's probably okay. FWIW I tested it manually.

Copy link
Contributor

github-actions bot commented Feb 9, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dylwil3 dylwil3 merged commit 0af4b23 into astral-sh:main Feb 9, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop when fixing file with cast and format strings
2 participants