Adopt the Ruff code linting tool

https://github.com/charliermarsh/ruff
This commit is contained in:
Adam Turner
2022-12-29 17:00:27 +00:00
parent f852661243
commit 8634fbce60
6 changed files with 78 additions and 3 deletions

View File

@@ -135,6 +135,54 @@ exclude = [
[tool.isort]
line_length = 95
[tool.ruff]
target-version = "py38" # Pin Ruff to Python 3.8
line-length = 95
exclude = [
'.git',
'.tox',
'.venv',
'tests/roots/*',
'build/*',
'doc/_build/*',
'sphinx/search/*',
'doc/usage/extensions/example*.py',
]
ignore = [
# pycodestyle
'E741',
# flake8-bugbear
'B006',
'B023',
# flake8-bugbear opinionated (disabled by default in flake8)
'B904',
'B905',
]
external = [ # Whitelist for RUF100 unkown code warnings
"E704",
"W291",
"W293",
]
select = [
"E", # pycodestyle
"F", # Pyflakes
"W", # pycodestyle
# plugins:
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"RUF100" # yesqa
]
[tool.ruff.per-file-ignores]
"tests/*" = ["E501"]
"sphinx/environment/collectors/toctree.py" = ["B026"]
"sphinx/environment/adapters/toctree.py" = ["B026"]
# Ruff does not support 'import-order-style = smarkets'
"sphinx/util/__init__.py" = ["F401"]
"sphinx/util/inspect.py" = ["F401"]
[tool.mypy]
check_untyped_defs = true
disallow_incomplete_defs = true