Skip to content
Snippets Groups Projects
Verified Commit 2767d54e authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

replace isort, flake8, and black with ruff extensions. Also add a LOT of new linting rules

parent 1295b282
No related branches found
No related tags found
1 merge request!111Feature/ruff everything party hat emoji
[tool.isort]
profile = "black"
line_length = 120
skip = ["venv", ".tox", "gso/migrations", "docs"]
known_third_party = ["pydantic", "migrations"]
known_first_party = ["test", "docs"]
[tool.black]
line-length = 120
target-version = ["py311"]
exclude = '''
(
/(
geant_service_orchestrator\.egg-info # exclude a few common directories in the
| \.git # root of the project
| \.*_cache
| \.tox
| venv
| docs
| gso/migrations
)/
)
'''
[tool.mypy]
exclude = [
"venv",
......@@ -60,45 +36,64 @@ exclude = [
"venv",
"gso/migrations",
"docs",
"_ipam.py" # TODO: remove
]
ignore = [
"C417",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D202",
"D203",
"D213",
"E501",
"N806",
"B905",
"N805",
"B904",
"N803",
"N801",
"N815",
"N802",
"S101"
]
line-length = 120
select = [
"A",
"ARG",
"B",
"BLE",
"C",
"COM",
"C4",
"C90",
"D",
"DTZ",
"E",
"EM",
"ERA",
"F",
"FA",
"FBT",
"FIX",
"FLY",
"FURB",
"G",
"I",
"ICN",
"INP",
"ISC",
"LOG",
"N",
"PERF",
"PGH",
"PIE",
"PL",
"PT",
"PTH",
"PYI",
"Q",
"RET",
"R",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLF",
"T",
"T20",
"TD",
"TID",
"TRY",
"UP",
"W",
"YTT"
]
target-version = "py311"
......@@ -106,7 +101,7 @@ target-version = "py311"
ban-relative-imports = "all"
[tool.ruff.per-file-ignores]
"test/*" = ["B033", "N816", "N802"]
"test/*" = ["S101", "PLR2004"]
[tool.ruff.isort]
known-third-party = ["pydantic", "migrations"]
......
[tox]
envlist = py311
[flake8]
; Allow >> on newline (W503), and allow cls as first argument for pydantic validators (B902)
ignore = B902,W503
exclude = .git,.*_cache,.eggs,*.egg-info,__pycache__,venv,.tox,gso/migrations,docs
enable-extensions = G
select = B,C,D,E,F,G,I,N,S,T,W,B902,B903,R
max-line-length = 120
ban-relative-imports = true
[pytest]
markers = workflow
......@@ -19,21 +10,16 @@ setenv =
OAUTH2_ACTIVE = False
deps =
coverage
flake8
black
mypy
ruff
isort
types-requests
celery-stubs
-r requirements.txt
commands =
isort -c .
ruff .
black --check .
ruff format --respect-gitignore --preview --check .
mypy .
flake8
coverage erase
coverage run --source gso --omit="gso/migrations/*" -m pytest {posargs}
coverage xml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment