We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
SIM118
not in
Last issue for now!
Ruff only detects in, but it should detect not in as well:
in
d = {} if "key" in d.keys(): pass if "key" not in d.keys(): pass
Ruff output:
$ ruff x.py x.py:3:4: SIM118 [*] Use `"key" in d` instead of `"key" in d.keys()`
Expected:
x.py:3:4: SIM118 [*] Use `"key" in d` instead of `"key" in d.keys()` x.py:6:4: SIM118 [*] Use `"key" not in d` instead of `"key" not in d.keys()`
The text was updated successfully, but these errors were encountered:
Extend SIM118 with not in
330f98d
Closes astral-sh#5989
5e8ddb5
1de4199
Extend SIM118 with not in (#5995)
3914fcb
Closes #5989 Tracking issue #1348
Successfully merging a pull request may close this issue.
Last issue for now!
Ruff only detects
in
, but it should detectnot in
as well:Ruff output:
Expected:
The text was updated successfully, but these errors were encountered: