-
Notifications
You must be signed in to change notification settings - Fork 73
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
fix: fix PLR1714 lint errors #202
Conversation
Please adjust https://github.com/nodejs/gyp-next/blob/main/pyproject.toml#L38 to make these changes permanent. |
@rzhao271 The |
@cclauss can the CI be restarted? The integration tests had an issue with finding the tarballs. |
%
ruff rule PLR1714
repeated-equality-comparison-target (PLR1714)
Derived from the Pylint linter.
What it does
Checks for repeated equality comparisons that can be rewritten as a membership test.
Why is this bad?
To check if a variable is equal to one of many values, it is common to write a series of equality comparisons (e.g.,
foo == "bar" or foo == "baz"
).Instead, prefer to combine the values into a collection and use the
in
operator to check for membership, which is more performant and succinct.If the items are hashable, use a
set
for efficiency; otherwise, use atuple
.Example
Use instead:
References
set