ruff: enable docstring format and set target version (MR 2252)

Allow automatic formatting of docstrings.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-13 05:06:03 +02:00 committed by Oliver Smith
parent 1f249529f7
commit 139c205424
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -29,10 +29,20 @@ version = {attr = "pmb.__version__"}
exclude = ["aports", "docs", "keys", "test", "test.pmb_test"] exclude = ["aports", "docs", "keys", "test", "test.pmb_test"]
[tool.ruff] [tool.ruff]
line-length=100
# Assume Python 3.8
target-version = "py38"
# E402: module import not on top of file, not possible for testcases # E402: module import not on top of file, not possible for testcases
# E722: do not use bare except # E722: do not use bare except
lint.ignore=["E402", "E722"] lint.ignore=["E402", "E722"]
line-length=100
[tool.ruff.lint.extend-per-file-ignores]
# F401: imported but unused, common for __init__.py files
"__init__.py" = ["F401"]
[tool.ruff.format]
# Enable auto-formatting of code examples in docstrings.
docstring-code-format = true
[tool.pytest.ini_options] [tool.pytest.ini_options]
addopts = [ addopts = [