Enable Ruff PLR (Pylint Refactor) (#13307)

This commit is contained in:
Avasam
2025-03-03 18:03:34 +01:00
committed by GitHub
parent 3e83e42a0f
commit 6f98c59f93
8 changed files with 18 additions and 8 deletions
+7
View File
@@ -46,6 +46,7 @@ select = [
"N", # pep8-naming
"PGH", # pygrep-hooks
"PLC", # Pylint Convention
"PLR", # Pylint Refactor
"RUF", # Ruff-specific and unused-noqa
"TRY", # tryceratops
"UP", # pyupgrade
@@ -142,6 +143,12 @@ ignore = [
# Used for direct, non-subclass type comparison, for example: `type(val) is str`
# see https://github.com/astral-sh/ruff/issues/6465
"E721", # Do not compare types, use `isinstance()`
# Leave the size and complexity of tests to human interpretation
"PLR09", # Too many ...
# Too many magic number "2" that are preferable inline. https://github.com/astral-sh/ruff/issues/10009
"PLR2004", # Magic value used in comparison, consider replacing `{value}` with a constant variable
# Keep codeflow path separation explicit
"PLR5501", # Use `elif` instead of `else` then `if`, to reduce indentation
# Mostly from scripts and tests, it's ok to have messages passed directly to exceptions
"TRY003", # Avoid specifying long messages outside the exception class
# Slower and more verbose https://github.com/astral-sh/ruff/issues/7871