Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refurb] Implement single-item-membership-test (FURB171) #7815

Merged
merged 4 commits into from
Oct 8, 2023

Conversation

tjkuson
Copy link
Contributor

@tjkuson tjkuson commented Oct 4, 2023

Summary

Implement no-single-item-in as single-item-membership-test (FURB171).

Uses the helper function generate_comparison from the pycodestyle implementations; this function should probably be moved, but I am not sure where at the moment.

Update: moved it to ruff_python_ast::helpers.

Related to #1348.

Test Plan

cargo test

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

@tjkuson tjkuson marked this pull request as ready for review October 4, 2023 16:24
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 4, 2023

CodSpeed Performance Report

Merging #7815 will not alter performance

Comparing tjkuson:single-in (a067e8e) with main (bdd925c)

Summary

✅ 25 untouched benchmarks

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Oct 8, 2023
@charliermarsh
Copy link
Member

Thanks, looks great.

@charliermarsh charliermarsh enabled auto-merge (squash) October 8, 2023 13:59
@charliermarsh charliermarsh merged commit 62f1ee0 into astral-sh:main Oct 8, 2023
15 checks passed
@tjkuson tjkuson deleted the single-in branch October 8, 2023 19:41
konstin pushed a commit that referenced this pull request Oct 11, 2023
## Summary

Implement
[`no-single-item-in`](https://github.com/dosisod/refurb/blob/master/refurb/checks/iterable/no_single_item_in.py)
as `single-item-membership-test` (`FURB171`).

Uses the helper function `generate_comparison` from the `pycodestyle`
implementations; this function should probably be moved, but I am not
sure where at the moment.

Update: moved it to `ruff_python_ast::helpers`.

Related to #1348.

## Test Plan

`cargo test`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants