add pylint
This commit is contained in:
parent
8befc5092f
commit
aae043e0a4
|
@ -172,12 +172,19 @@ select = [
|
|||
# "ERA", # eradicate
|
||||
"F", # pyflakes
|
||||
"N", # pep8-naming
|
||||
# "PL", # pylint
|
||||
"PL", # pylint
|
||||
# "S", # flake8-bandit
|
||||
"UP", # pyupgrade
|
||||
"W", # pycodestyle warning
|
||||
"I001" # isort
|
||||
]
|
||||
|
||||
ignore = [
|
||||
"PLR", # "refactoring" category has "too many lines in method" type stuff
|
||||
"PLC1901",
|
||||
"PLE1205" # saw this Too many arguments for `logging` format string give a false positive once
|
||||
]
|
||||
|
||||
line-length = 130
|
||||
|
||||
# target python 3.10
|
||||
|
@ -185,6 +192,7 @@ target-version = "py310"
|
|||
|
||||
[tool.ruff.per-file-ignores]
|
||||
"migrations/versions/*.py" = ["E501"]
|
||||
"tests/**/*.py" = ["PLR2004"]
|
||||
|
||||
[tool.ruff.isort]
|
||||
force-single-line = true
|
||||
|
|
|
@ -139,7 +139,7 @@ permission_cache = None
|
|||
|
||||
def get_users() -> Any:
|
||||
"""Load users from a local configuration file."""
|
||||
global permission_cache
|
||||
global permission_cache # noqa: PLW0603, allow global for performance
|
||||
if not permission_cache:
|
||||
with open(current_app.config["SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_ABSOLUTE_PATH"]) as file:
|
||||
permission_cache = yaml.safe_load(file)
|
||||
|
|
|
@ -160,7 +160,7 @@ class Script:
|
|||
def get_all_subclasses(cls) -> list[type[Script]]:
|
||||
"""Get_all_subclasses."""
|
||||
# This is expensive to generate, never changes after we load up.
|
||||
global SCRIPT_SUB_CLASSES
|
||||
global SCRIPT_SUB_CLASSES # noqa: PLW0603, allow global for performance
|
||||
if not SCRIPT_SUB_CLASSES:
|
||||
SCRIPT_SUB_CLASSES = Script._get_all_subclasses(Script)
|
||||
return SCRIPT_SUB_CLASSES
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import json
|
||||
|
||||
import pytest
|
||||
from flask.app import Flask
|
||||
from flask.testing import FlaskClient
|
||||
|
|
Loading…
Reference in New Issue