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

Merged
merged 14 commits into from
Mar 3, 2025
Merged

Enable Ruff PLR (Pylint Refactor) #13307

merged 14 commits into from
Mar 3, 2025

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

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@Avasam Avasam requested a review from srittau March 2, 2025 04:08

This comment has been minimized.

@srittau
Copy link
Collaborator

srittau commented Mar 3, 2025

This has (not suprisingly) conflicts after merging #13306.

Copy link
Contributor

github-actions bot commented Mar 3, 2025

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

@srittau srittau merged commit 6f98c59 into python:main Mar 3, 2025
63 checks passed
@Avasam Avasam deleted the Ruff-PLR branch March 3, 2025 20:01
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.

3 participants