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

Enable Ruff PLR (Pylint Refactor) #13307

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Enable Ruff PLR (Pylint Refactor) #13307

wants to merge 4 commits into from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Dec 26, 2024

Ref #13295
https://docs.astral.sh/ruff/rules/#refactor-r

There's a few nice automated fixes between more concise conditions and imports.

magic-value-comparison (PLR2004) is a harder call. It found some magic numbers that definitely should use HTTPStatus. But I also don't think creating constants for literal 2 is worth it.
Even at work we allow 2 literals in our ESLint configs for JS/TS.
There's an open issue to make this configurable per-literal: astral-sh/ruff#10009
We could noqa, disable it globally, or wait for a resolution on that Ruff issue.

This comment has been minimized.

@Avasam Avasam changed the title Enable PLR (Pylint Refactor) Enable Ruff PLR (Pylint Refactor) Dec 26, 2024
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant