Migrate to ruff

This commit is contained in:
2023-01-07 22:44:29 +01:00
parent 0cd3ae6c03
commit 1079de76a5
5 changed files with 543 additions and 371 deletions

View File

@@ -5,8 +5,8 @@ description = ""
authors = ["Kurbanov Bulat <kurbanovbul@gmail.com>"]
[tool.poetry.dependencies]
python = "^3.9"
fastapi = "^0.88.0"
python = "^3.11"
fastapi = "^0.89.0"
python-multipart = "^0.0.5"
aiofiles = "^22.1.0"
uvicorn = {extras = ["standart"], version = "^0.20.0"}
@@ -18,7 +18,8 @@ fastapi-utils = "^0.2.1"
greenlet = "^2.0.1"
pydantic = "^1.10.4"
[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
pre-commit = "^2.21.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
@@ -35,14 +36,13 @@ exclude = '''
)/
'''
[tool.flake8]
ignore = [
# Whitespace before ':' ( https://www.flake8rules.com/rules/E203.html )
"E203"
]
max-line-length=88
max-complexity = 15
select = "B,C,E,F,W,T4,B9"
[tool.ruff]
fix = true
target-version = "py311"
src = ["app"]
line-length=88
ignore = []
select = ["B", "C", "E", "F", "W", "B9", "I001"]
exclude = [
# No need to traverse our git directory
".git",
@@ -53,13 +53,20 @@ exclude = [
# The old directory contains Flake8 2.0
]
[tool.isort]
profile = "black"
only_sections = true
force_sort_within_sections = true
lines_after_imports = 2
lexicographical = true
sections = ["FUTURE", "STDLIB", "BASEFRAMEWORK", "FRAMEWORKEXT", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
known_baseframework = ["fastapi",]
known_frameworkext = ["starlette",]
src_paths = ["app"]
[tool.ruff.flake8-bugbear]
extend-immutable-calls = ["fastapi.File", "fastapi.Form"]
[tool.ruff.mccabe]
max-complexity = 15
[tool.ruff.isort]
# only_sections = true
# force_sort_within_sections = true
# lines_after_imports = 2
# lexicographical = true
# sections = ["FUTURE", "STDLIB", "BASEFRAMEWORK", "FRAMEWORKEXT", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
# known_baseframework = ["fastapi",]
# known_frameworkext = ["starlette",]
[tool.ruff.pyupgrade]
keep-runtime-typing = true