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

Add linter tools

Add ruff, isort, black, and mypy to the tox suite
Add pyproject.toml with settings compatible with orchestrator-core codestyle
parent 9361ed85
Branches
Tags
1 merge request!36Add linter tools, and resolve all linting errors
[tool.isort]
profile = "black"
line_length = 120
skip = ["venv", ".tox", "gso/migrations"]
known_third_party = ["pydantic", "migrations"]
known_first_party = ["test"]
[tool.black]
line-length = 120
target-version = ["py310"]
[tool.mypy]
exclude = "venv"
ignore_missing_imports = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
strict_optional = true
namespace_packages = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_no_return = true
warn_unreachable = true
implicit_reexport = false
strict_equality = true
show_error_codes = true
show_column_numbers = true
# Suppress "note: By default the bodies of untyped functions are not checked"
disable_error_code = "annotation-unchecked"
[tool.ruff]
exclude = [
".git",
".*_cache",
".tox",
"*.egg-info",
"__pycache__",
"htmlcov",
"venv",
]
ignore = [
"C417",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D202",
"E501",
"N806",
"B905",
"N805",
"B904",
"N803",
"N801",
"N815",
"N802"
]
line-length = 120
select = [
"B",
"C",
"D",
"E",
"F",
"I",
"N",
"RET",
"S",
"T",
"W",
]
target-version = "py310"
[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.per-file-ignores]
"test/*" = ["S101", "B033", "N816", "N802"]
[tool.ruff.isort]
known-third-party = ["pydantic"]
known-first-party = ["migrations", "test"]
......@@ -8,3 +8,4 @@ black
isort
flake8
mypy
ruff
[flake8]
exclude = venv,.tox, migrations
ignore = D100,D101,D102,D103,D104,D105,D106,D107,D202,E501,RST301,RST304,W503,E203,C417,T202
; extend-ignore = E203
exclude = .git,.*_cache,.eggs,*.egg-info,__pycache__,venv,.tox,gso/migrations
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
per-file-ignores =
# Allow first argument to be cls instead of self for pydantic validators
gso/*: B902
test/*: S101
[testenv]
deps =
coverage
flake8
black
mypy
ruff
isort
-r requirements.txt
commands =
......@@ -14,4 +28,8 @@ commands =
coverage html
# coverage report --fail-under 80
coverage report
isort -c .
ruff .
black --check .
mypy .
flake8
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment