Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[refurb] Make fix unsafe if it deletes comments (FURB145)#22670

Merged
ntBre merged 2 commits intoastral-sh:mainfrom
chirizxc:FURB145
Jan 20, 2026
Merged

[refurb] Make fix unsafe if it deletes comments (FURB145)#22670
ntBre merged 2 commits intoastral-sh:mainfrom
chirizxc:FURB145

Conversation

@chirizxc
Copy link
Contributor

Summary

Test Plan

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 17, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

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.

We should also update the documentation to mention that the fix is unsafe if there's a comment (I don't think it's necessary to add a code example, a short sentence should be sufficient)

/// ## Fix safety
/// This rule's fix is marked as unsafe if there's comments inside the dict comprehension,
/// as comments may be removed.

@chirizxc
Copy link
Contributor Author

Thank you.

We should also update the documentation to mention that the fix is unsafe if there's a comment (I don't think it's necessary to add a code example, a short sentence should be sufficient)

/// ## Fix safety
/// This rule's fix is marked as unsafe if there's comments inside the dict comprehension,
/// as comments may be removed.

I think it's ready, the rest of the PRs have also changed.

@ntBre ntBre added the fixes Related to suggested fixes for violations label Jan 20, 2026
@ntBre ntBre merged commit 94ccbd2 into astral-sh:main Jan 20, 2026
42 checks passed
@chirizxc chirizxc deleted the FURB145 branch January 20, 2026 15:18
carljm added a commit that referenced this pull request Jan 20, 2026
* main: (149 commits)
  Preserve required parentheses in lambda bodies (#22747)
  [`flake8-simplify`] Make fix unsafe if it deletes comments (`SIM911`) (#22661)
  [`refurb`] Make fix unsafe if it deletes comments (`FURB145`) (#22670)
  [`ruff`] Make fix unsafe if it deletes comments (`RUF020`) (#22664)
  [ty] Add README for `ty_completion_bench` CLI tool
  [ty] Update completion eval
  [ty] Collect completions into a max-heap
  [ty] Truncate imports and qualifications derived from completions
  [ty] Get rid of high-level completion deduplication
  [ty] Refactor how we sort completions
  [ty] Optimize collection of "all symbols"
  [ty] Speed up completions by tweaking sorts
  [ty] Add new `ty_completion_bench` for ad hoc benchmarking
  gitignore: ignore scratch directories in completion eval truth directory
  [`pyupgrade`] Allow shadowing non-builtin bindings (`UP029`) (#22749)
  [ty] Emit invalid type form for stringified annotations (#22752)
  [ty] Allow `if type(x) is Y` narrowing for types other than class-literal types (#22729)
  [ty] Add basic support for overloads in `ParamSpec` (#21946)
  [`ruff`] Make fix unsafe if it deletes comments (`RUF019`) (#22663)
  [`flake8-bugbear`] Make fix unsafe if it deletes comments (`B014`) (#22659)
  ...
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.

3 participants