ruff/crates/ruff_linter/resources/test/fixtures/refurb
Takayuki Maeda 821b2f8b2e
[`refurb`] Mark `single-item-membership-test` fix as always unsafe (`FURB171`) (#20279)
<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->

Fixes #20255

Mark single-item-membership-test fixes as always unsafe

- Always set `Applicability::Unsafe` for FURB171 fixes
- Update “Fix safety” docs to reflect always-unsafe behavior
- Expand tests (not in, nested set/frozenset, commented args)

## Test Plan

<!-- How was it tested? -->

I have added new test cases to
`crates/ruff_linter/resources/test/fixtures/refurb/FURB171_0.py` and
`crates/ruff_linter/resources/test/fixtures/refurb/FURB171_1.py`.

---------

Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2025-09-18 15:24:15 +00:00
..
FURB101.py [`refurb`] Do not allow any keyword arguments for `read-whole-file` in `rb` mode (`FURB101`) (#10803) 2024-04-06 12:41:39 -04:00
FURB103.py Improve handling of builtin symbols in linter rules (#10919) 2024-04-16 11:37:31 +01:00
FURB105.py Treat `sep` arguments with effects as unsafe removals (#13165) 2024-08-30 12:17:47 -04:00
FURB110.py Respect operator precedence in `FURB110` (#11464) 2024-05-19 03:17:11 +00:00
FURB113.py Avoid `FURB113` autofix if comments are present (#8494) 2023-11-09 03:10:11 +00:00
FURB116.py [`refurb`] Mark autofix as safe only for number literals in `FURB116` (#17692) 2025-05-12 16:08:12 -04:00
FURB118.py [`refurb`] Ignore decorated functions for `FURB118` (#19339) 2025-07-25 10:43:17 -05:00
FURB122.py [`refurb`] Parenthesize lambda and ternary expressions in iter (`FURB122`, `FURB142`) (#18592) 2025-06-09 16:07:34 -04:00
FURB129.py [`refurb`] Mark `FURB129` autofix as unsafe if there's comments in the `readlines` call (#18858) 2025-06-22 08:51:37 +01:00
FURB131.py Improve inference capabilities of the `BuiltinTypeChecker` (#10976) 2024-04-16 18:53:22 +01:00
FURB132.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
FURB136.py Implement FURB136 (#8664) 2023-11-15 18:10:13 +00:00
FURB140.py Avoid suggesting starmap when arguments are used outside call (#11830) 2024-06-10 17:10:06 -04:00
FURB142.py [`refurb`] Parenthesize lambda and ternary expressions in iter (`FURB122`, `FURB142`) (#18592) 2025-06-09 16:07:34 -04:00
FURB145.py Rename `ruff` crate to `ruff_linter` (#7529) 2023-09-20 08:38:27 +02:00
FURB148.py Check sequence type before triggering `unnecessary-enumerate` (`FURB148`) `len` suggestion (#7781) 2023-10-03 14:39:14 +00:00
FURB152.py [`refurb`] Avoid false positives for `math-constant` (`FURB152`) (#9290) 2023-12-27 09:45:37 -05:00
FURB154.py [`refurb`] Implement `repeated-global` (`FURB154`) (#11187) 2024-06-08 20:35:40 +00:00
FURB156.py [FURB156] Do not consider docstring(s) (#16391) 2025-02-26 16:30:13 +00:00
FURB157.py [`refurb`] Avoid panicking `unwrap` in `verbose-decimal-constructor` (`FURB157`) (#16777) 2025-03-17 05:09:07 -05:00
FURB161.py [`refurb`] Mark the `FURB161` fix unsafe except for integers and booleans (#17240) 2025-04-18 13:46:01 -04:00
FURB162.py [`refurb`] Manual timezone monkeypatching (`FURB162`) (#16113) 2025-02-18 14:35:33 +01:00
FURB163.py [`refurb`] Fix `FURB163` autofix creating a syntax error for `yield` expressions (#18756) 2025-06-23 10:13:03 +02:00
FURB164.py [`refurb`] Mark `int` and `bool` cases for `Decimal.from_float` as safe fixes in `FURB164` tests (#19468) 2025-07-28 14:21:38 +00:00
FURB166.py [`refurb`] Implement `int-on-sliced-str` (`FURB166`) (#10650) 2024-04-02 19:29:42 +00:00
FURB167.py [`refurb`] Implement `regex-flag-alias` with fix (`FURB167`) (#9516) 2024-01-14 23:40:17 +00:00
FURB168.py [`refurb`] Fix false positive on empty tuples (`FURB168`) (#19058) 2025-07-01 10:26:41 -04:00
FURB169.py [`refurb`] Also report non-name expressions (`FURB169`) (#15905) 2025-02-05 08:46:37 +01:00
FURB171_0.py [`refurb`] Mark `single-item-membership-test` fix as always unsafe (`FURB171`) (#20279) 2025-09-18 15:24:15 +00:00
FURB171_1.py [`refurb`] Mark `single-item-membership-test` fix as always unsafe (`FURB171`) (#20279) 2025-09-18 15:24:15 +00:00
FURB177.py [`refurb`] Implement `implicit-cwd` (FURB177) (#7704) 2023-09-29 02:18:59 +00:00
FURB180.py [`refurb`] Implement `metaclass_abcmeta` (`FURB180`) (#9658) 2024-01-31 22:31:12 +00:00
FURB181.py [`refurb`] Implement `hashlib-digest-hex` (`FURB181`) (#9077) 2023-12-10 02:00:11 +00:00
FURB187.py [`refurb`] Implement `list_assign_reversed` lint (FURB187) (#10212) 2024-03-21 17:09:09 +00:00
FURB188.py [`refurb`] Correctly handle lengths of literal strings in `slice-to-remove-prefix-or-suffix` (`FURB188`) (#16237) 2025-02-18 12:52:26 -06:00
FURB189.py [refurb] Check for subclasses includes subscript expressions (FURB189) (#16155) 2025-02-14 20:21:26 +01:00
FURB192.py [`refurb`] New rule to suggest min/max over sorted() (`FURB192`) (#10868) 2024-04-23 01:13:57 +00:00