From 139c205424f5a0454cd2939fe53548b140d2f649 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Thu, 13 Jun 2024 05:06:03 +0200 Subject: [PATCH] ruff: enable docstring format and set target version (MR 2252) Allow automatic formatting of docstrings. Signed-off-by: Caleb Connolly --- pyproject.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5cac3249..f44158d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,10 +29,20 @@ version = {attr = "pmb.__version__"} exclude = ["aports", "docs", "keys", "test", "test.pmb_test"] [tool.ruff] +line-length=100 +# Assume Python 3.8 +target-version = "py38" # E402: module import not on top of file, not possible for testcases # E722: do not use bare except 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] addopts = [