[ruff] Make fix unsafe if it deletes comments (RUF020)#22664
[ruff] Make fix unsafe if it deletes comments (RUF020)#22664ntBre merged 3 commits intoastral-sh:mainfrom
ruff] Make fix unsafe if it deletes comments (RUF020)#22664Conversation
|
ntBre
left a comment
There was a problem hiding this comment.
Thank you! This looks fine to me, just one suggestion about sharing the applicability check.
(I almost wonder if this could warrant a helper method on Checker since this is such a common pattern, but I couldn't think of a great name/API for it earlier)
I kind of agree after seeing all these PRs. Perhaps something like |
|
Yeah I just couldn't decide how magical it should be. Something like: diagnostic.set_applicable_fix(checker.comment_ranges(), edit);could also be nice. I don't think |
* 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) ...
Summary
Test Plan