Skip to content

[pyflakes] Mark F504/F522/F523 autofix as unsafe if there's a call with side effect - #18839

Merged
MichaReiser merged 6 commits into
astral-sh:mainfrom
LaBatata101:fix-F504
Jun 26, 2025
Merged

MichaReiser merged 6 commits into
astral-sh:mainfrom
LaBatata101:fix-F504

Conversation

@LaBatata101

Copy link
Copy Markdown
Contributor

Summary

Fixes #18806

Test Plan

Add regression test

Comment thread crates/ruff_linter/src/rules/pyflakes/rules/strings.rs Outdated
@github-actions

github-actions Bot commented Jun 20, 2025 •

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@LaBatata101
LaBatata101 requested a review from MichaReiser June 24, 2025 19:32
@LaBatata101 LaBatata101 changed the title [pyflakes] Mark F504/F522/F523 autofix as unsafe if there's a call expression in the format part [pyflakes] Mark F504/F522/F523 autofix as unsafe if there's a call with side effect Jun 24, 2025
@MichaReiser
MichaReiser removed their request for review June 25, 2025 06:38
Comment thread crates/ruff_linter/src/rules/pyflakes/rules/strings.rs Outdated
Comment thread crates/ruff_linter/src/rules/pyflakes/rules/strings.rs Outdated
Comment thread crates/ruff_linter/src/rules/pyflakes/rules/strings.rs Outdated
Comment thread crates/ruff_linter/src/rules/pyflakes/rules/strings.rs Outdated
@LaBatata101
LaBatata101 requested a review from MichaReiser June 25, 2025 22:12
@MichaReiser MichaReiser added the fixes Related to suggested fixes for violations label Jun 26, 2025

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you

@MichaReiser
MichaReiser enabled auto-merge (squash) June 26, 2025 08:45
@MichaReiser
MichaReiser merged commit 2362263 into astral-sh:main Jun 26, 2025
dcreager added a commit that referenced this pull request Jun 26, 2025
* main:
  [ty] Add regression-benchmark for attribute-assignment hang (#18957)
  [ty] Format conflicting types as an enumeration (#18956)
  [ty] Prevent union builder construction for just one declaration (#18954)
  [ty] Infer nonlocal types as unions of all reachable bindings (#18750)
  [`pyflakes`] Mark `F504`/`F522`/`F523` autofix as unsafe if there's a call with side effect (#18839)
  [`playground`] Add ruff logo docs link to Header.tsx (#18947)
  [ty] Reduce the overwhelming complexity of `TypeInferenceBuilder::infer_call_expression` (#18943)
  [ty] Add subdiagnostic about empty bodies in more cases (#18942)
  [ty] Move search path resolution to `Options::to_program_settings` (#18937)
  [`flake8-errmsg`] Extend `EM101` to support byte strings (#18867)
  Move big rule implementations (#18931)
  [`pylint`] Allow fix with comments and document performance implications (`PLW3301`) (#18936)
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.

[Pyflakes] F504 fix changes behavior if args have side effects

3 participants