chore: refurish python code by applying Pylint linter rules (#8322)

This commit is contained in:
Bowen Liang
2024-09-13 22:42:08 +08:00
committed by GitHub
parent 1ab81b4972
commit a1104ab97e
126 changed files with 253 additions and 272 deletions

View File

@@ -6,6 +6,9 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
exclude=[
"migrations/*",
]
line-length = 120
[tool.ruff.lint]
@@ -19,6 +22,13 @@ select = [
"I", # isort rules
"N", # pep8-naming
"PT", # flake8-pytest-style rules
"PLC0208", # iteration-over-set
"PLC2801", # unnecessary-dunder-call
"PLC0414", # useless-import-alias
"PLR0402", # manual-from-import
"PLR1711", # useless-return
"PLR1714", # repeated-equality-comparison
"PLR6201", # literal-membership
"RUF019", # unnecessary-key-check
"RUF100", # unused-noqa
"RUF101", # redirected-noqa
@@ -78,9 +88,6 @@ ignore = [
"libs/gmpy2_pkcs10aep_cipher.py" = [
"N803", # invalid-argument-name
]
"migrations/versions/*" = [
"E501", # line-too-long
]
"tests/*" = [
"F401", # unused-import
"F811", # redefined-while-unused
@@ -88,7 +95,6 @@ ignore = [
[tool.ruff.format]
exclude = [
"migrations/**/*",
]
[tool.pytest_env]