Skip to content

Conversation

@TaKO8Ki
Copy link
Contributor

@TaKO8Ki TaKO8Ki commented Sep 4, 2025

Summary

Fixes #20238

Replace inline f-string emptiness check with is_empty_f_string helper function

Test Plan

I have added test cases to crates/ruff_linter/resources/test/fixtures/ruff/RUF060.py

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

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

Can you move these new examples to the end of the file and put a link to the relevant GitHub issue in a comment above them?

@ntBre ntBre added the bug Something isn't working label Sep 4, 2025
@dylwil3 dylwil3 changed the title [RUF060] Use helper function for empty f-string detection [ruff] Use helper function for empty f-string detection in in-empty-collection (RUF060) Sep 4, 2025
@dylwil3 dylwil3 added the rule Implementing or modifying a lint rule label Sep 4, 2025
@dylwil3 dylwil3 added the preview Related to preview mode features label Sep 4, 2025
Copy link
Collaborator

@dylwil3 dylwil3 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!

@dylwil3 dylwil3 enabled auto-merge (squash) September 4, 2025 20:19
@dylwil3 dylwil3 merged commit 670fffe into astral-sh:main Sep 4, 2025
35 checks passed
@TaKO8Ki TaKO8Ki deleted the ruf060-use-helper-function branch September 4, 2025 20:21
dylwil3 pushed a commit that referenced this pull request Sep 5, 2025
…y-collection` (`RUF060`) (#20249)

## Summary

Fixes #20238

Replace inline f-string emptiness check with `is_empty_f_string` helper
function
second-ed pushed a commit to second-ed/ruff that referenced this pull request Sep 9, 2025
…y-collection` (`RUF060`) (astral-sh#20249)

## Summary

Fixes astral-sh#20238

Replace inline f-string emptiness check with `is_empty_f_string` helper
function
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.

RUF060 analyzes f"" "1" as empty

3 participants