feat: replace isort, flake8 & black with ruff

This commit is contained in:
psychedelicious 2023-11-11 10:06:21 +11:00
parent 9ccfa34e04
commit 884ec0b5df

View File

@ -96,10 +96,7 @@ dependencies = [
]
"dev" = ["jurigged", "pudb"]
"test" = [
"black",
"flake8",
"Flake8-pyproject",
"isort",
"ruff",
"mypy",
"pre-commit",
"pytest>6.0.0",
@ -194,10 +191,16 @@ directory = "coverage/html"
output = "coverage/index.xml"
#=== End: PyTest and Coverage
[tool.flake8]
max-line-length = 120
ignore = ["E203", "E266", "E501", "W503"]
select = ["B", "C", "E", "F", "W", "T4"]
#=== Begin: Ruff
[tool.ruff]
line-length = 120
ignore = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"C901", # https://docs.astral.sh/ruff/rules/complex-structure/
"B008", # https://docs.astral.sh/ruff/rules/function-call-in-default-argument/
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/
]
select = ["B", "C", "E", "F", "W"]
exclude = [
".git",
"__pycache__",
@ -206,14 +209,9 @@ exclude = [
"invokeai/frontend/web/node_modules/",
".venv*",
]
#=== End: Ruff
[tool.black]
line-length = 120
[tool.isort]
profile = "black"
line_length = 120
#=== Begin: MyPy
[tool.mypy]
ignore_missing_imports = true # ignores missing types in third-party libraries
@ -263,3 +261,4 @@ module = [
"invokeai.backend.util.util",
"invokeai.frontend.install.model_install",
]
#=== End: MyPy