diff --git a/pyproject.toml b/pyproject.toml index 19b4ae559111f4748c8e3388b79c5d2c9cbb9817..b0097659e16da3dbe5b85f949a414bc0c9f7d131 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,27 +1,3 @@ -[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"] diff --git a/tox.ini b/tox.ini index 964fcad5950a7538a41f2140939eeb8438ba0925..40ad7edb34f5a0141091c81717adf68438b19c66 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,6 @@ [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