Skip to content

Conversation

@IDrokin117
Copy link
Contributor

Summary

Resolves #20282

Makes the rule fix always unsafe, because the replacement may not be semantically equivalent to the original expression, potentially changing the behavior of the code.

Updated docstring with examples.

Test Plan

  • Added two tests from issue and regenerated the snapshot

@IDrokin117 IDrokin117 changed the title [flake8-bugbear] unreliable-callable-check always marked as unsafe (B004) [flake8-bugbear] unreliable-callable-check always marked as unsafe (B004) Sep 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

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

@ntBre ntBre added the fixes Related to suggested fixes for violations label Sep 12, 2025
@ntBre ntBre changed the title [flake8-bugbear] unreliable-callable-check always marked as unsafe (B004) [flake8-bugbear] Mark the fix for unreliable-callable-check as always unsafe (B004) Sep 12, 2025
@ntBre ntBre enabled auto-merge (squash) September 12, 2025 19:24
@ntBre ntBre merged commit dfec946 into astral-sh:main Sep 12, 2025
35 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unreliable-callable-check (B004) should be marked unsafe

2 participants