Skip to content

[refurb] Add coverage of set and frozenset calls (FURB171)#18035

Merged
ntBre merged 1 commit intoastral-sh:mainfrom
naslundx:single-item-membership-test-missing-set-constructor
May 29, 2025
Merged

[refurb] Add coverage of set and frozenset calls (FURB171)#18035
ntBre merged 1 commit intoastral-sh:mainfrom
naslundx:single-item-membership-test-missing-set-constructor

Conversation

@naslundx
Copy link
Contributor

…ItemMembershipTest

Summary

Adds coverage of using set(...) in addition to `{...} in SingleItemMembershipTest.

Fixes #15792
(and replaces the old PR #15793)

Test Plan

Updated unit test and snapshot.

Steps to reproduce are in the issue linked above.

@github-actions
Copy link
Contributor

github-actions bot commented May 12, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@naslundx naslundx force-pushed the single-item-membership-test-missing-set-constructor branch from e1e31b0 to 0414342 Compare May 12, 2025 09:50
@ntBre ntBre self-requested a review May 13, 2025 01:39
@ntBre ntBre added rule Implementing or modifying a lint rule preview Related to preview mode features labels May 14, 2025
@ntBre ntBre changed the title (FURB171) Add coverage of using set(...) and frozenset(...) in Single… [refurb] Add coverage of set and frozenset calls (FURB171) May 14, 2025
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.

Thanks! The implementation looks reasonable to me. Would you mind moving the new test cases to the end of the test file? That will make it a lot easier to review that part.

Alternatively you could move FURB171.py to FURB171_0.py and add your new tests in FURB171_1.py.

cc @dylwil3 and @AlexWaygood since y'all reviewed the previous iteration of this PR (#15793).

@naslundx
Copy link
Contributor Author

Fixed the suggested tweaks, will reorg the test cases as well

@naslundx naslundx force-pushed the single-item-membership-test-missing-set-constructor branch from e6c2d56 to 2a908cd Compare May 23, 2025 08:17
@naslundx naslundx force-pushed the single-item-membership-test-missing-set-constructor branch from 2a908cd to 0863a09 Compare May 23, 2025 08:21
@naslundx
Copy link
Contributor Author

There we go. Back to you @ntBre !

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.

Looks great, thank you!

@ntBre ntBre merged commit 9d3cad9 into astral-sh:main May 29, 2025
34 checks passed
dcreager added a commit that referenced this pull request May 30, 2025
* main:
  [ty] support callability of bound/constrained typevars (#18389)
  [ty] Minor tweaks to "list all members" docs and tests (#18388)
  [ty] Fix broken property tests for disjointness (#18384)
  [ty] List available members for a given type (#18251)
  [`airflow`] Add unsafe fix for module moved cases (`AIR312`) (#18363)
  Add a `SourceFile` to `OldDiagnostic` (#18356)
  Update salsa past generational id change (#18362)
  [`airflow`] Add unsafe fix for module moved cases (`AIR311`) (#18366)
  [`airflow`] Add unsafe fix for module moved cases (`AIR301`) (#18367)
  [ty] Improve tests for `site-packages` discovery (#18374)
  [ty] _typeshed.Self is not a special form (#18377)
  [ty] Callable types are disjoint from non-callable `@final` nominal instance types (#18368)
  [ty] Add diagnosis for function with no return statement but with return type annotation (#18359)
  [`airflow`] Add unsafe fix module moved cases (`AIR302`) (#18093)
  Rename `ruff_linter::Diagnostic` to `OldDiagnostic` (#18355)
  [`refurb`] Add coverage of `set` and `frozenset` calls (`FURB171`) (#18035)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Related to preview mode features rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FURB171 Does not trigger when calling set(...)

2 participants