Skip to content

[ruff] Trigger RUF037 for empty string and byte strings#18862

Merged
MichaReiser merged 4 commits intoastral-sh:mainfrom
LaBatata101:fix-RUF037
Jun 24, 2025
Merged

[ruff] Trigger RUF037 for empty string and byte strings#18862
MichaReiser merged 4 commits intoastral-sh:mainfrom
LaBatata101:fix-RUF037

Conversation

@LaBatata101
Copy link
Contributor

Summary

Fixes #18854

Test Plan

Add regression test

@github-actions
Copy link
Contributor

github-actions bot commented Jun 22, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@LaBatata101 LaBatata101 requested a review from MichaReiser June 23, 2025 20:19
Copy link
Member

@MichaReiser MichaReiser 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

@MichaReiser MichaReiser added rule Implementing or modifying a lint rule preview Related to preview mode features labels Jun 24, 2025
@MichaReiser MichaReiser merged commit ca79338 into astral-sh:main Jun 24, 2025
35 checks passed
@LaBatata101 LaBatata101 deleted the fix-RUF037 branch June 24, 2025 13:01
dcreager added a commit that referenced this pull request Jun 24, 2025
* main:
  [ty] Fix false positives when subscripting an object inferred as having an `Intersection` type (#18920)
  [`flake8-use-pathlib`] Add autofix for `PTH202` (#18763)
  [ty] Add relative import completion tests
  [ty] Clarify what "cursor" means
  [ty] Add a cursor test builder
  [ty] Enforce sort order of completions (#18917)
  [formatter] Fix missing blank lines before decorated classes in .pyi files (#18888)
  Apply fix availability and applicability when adding to `DiagnosticGuard` and remove `NoqaCode::rule` (#18834)
  py-fuzzer: allow relative executable paths (#18915)
  [ty] Change `environment.root` to accept multiple paths (#18913)
  [ty] Rename `src.root` setting to `environment.root` (#18760)
  Use file path for detecting package root (#18914)
  Consider virtual path for various server actions (#18910)
  [ty] Introduce `UnionType::try_from_elements` and `UnionType::try_map` (#18911)
  [ty] Support narrowing on `isinstance()`/`issubclass()` if the second argument is a dynamic, intersection, union or typevar type (#18900)
  [ty] Add decorator check for implicit attribute assignments (#18587)
  [`ruff`] Trigger `RUF037` for empty string and byte strings (#18862)
  [ty] Avoid duplicate diagnostic in unpacking (#18897)
  [`pyupgrade`] Extend version detection to include `sys.version_info.major` (`UP036`) (#18633)
  [`ruff`] Frozen Dataclass default should be valid (`RUF009`) (#18735)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[RUF] [preview] RUF037 could support empty strings

2 participants

Comments