Use Ruff and fix all its warnings and errors

This commit is contained in:
2023-03-19 00:54:21 +01:00
parent ec2978b529
commit 11d9f2c2a5
10 changed files with 687 additions and 363 deletions

View File

@ -39,4 +39,81 @@ requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.isort]
profile = "black"
profile = "black"
[tool.ruff]
line-length = 120
select = [
"E",
"F",
"B",
"W",
"C90",
"I",
"N",
"D",
"UP",
"YTT",
"ANN",
"S",
"BLE",
"FBT",
"A",
"COM",
"C4",
"DTZ",
"EM",
"EXE",
"ISC",
"ICN",
"G",
"INP",
"PIE",
"T20",
"PYI",
"PT",
"Q",
"RSE",
"RET",
"SLF",
"SIM",
"TID",
"TCH",
"ARG",
"PTH",
"ERA",
"PGH",
"PL",
"PLC",
"PLE",
"PLR",
"PLW",
"TRY",
"RUF",
]
ignore = [
"D100", # pydocstyle - missing docstring in public module
"D101", # pydocstyle - missing docstring in public class
"D102", # pydocstyle - missing docstring in public method
"D103", # pydocstyle - missing docstring in public function
"D104", # pydocstyle - missing docstring in public package
"D105", # pydocstyle - missing docstring in magic method
"D106", # pydocstyle - missing docstring in public nested class
"D107", # pydocstyle - missing docstring in __init__
"G002", # Allow % in logging
"UP031", # Allow % in logging
]
[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
[tool.ruff.pydocstyle]
convention = "google"
[tool.black]
line-length = 120
[tool.pytest.ini_options]
addopts = "-vvvvvv --exitfirst"
filterwarnings = ["ignore::DeprecationWarning:pkg_resources:121"]