From aa153f47021caed5612615e276da8eba9fb2b5be Mon Sep 17 00:00:00 2001 From: "Reza (Shahin) Khanipour" Date: Mon, 22 Jul 2024 10:50:35 +0200 Subject: [PATCH] feat(Python): Configure pytest and ruff in pyproject.toml. --- .../pyproject.toml.jinja | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/pyproject.toml.jinja b/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/pyproject.toml.jinja index 09fb395..a8a5d76 100644 --- a/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/pyproject.toml.jinja +++ b/template/{% if language == 'Python' %}{{ project_name }}{% endif %}/pyproject.toml.jinja @@ -14,6 +14,28 @@ license = {text = "{{project_license}}"} requires = ["pdm-backend"] build-backend = "pdm.backend" - [tool.pdm] distribution = true + +[tool.ruff] +line-length = 120 +target-version = "py311" +select = [ + "E", # pycodestyle + "F", # pyflakes + "UP", # pyupgrade + "D" # pydocstyle +] + +[tool.ruff.pydocstyle] +convention = "google" + +[tool.coverage.run] +branch = true +relative_files = true +source = [ + "src/{{ project_name }}", +] + +[tool.coverage.report] +skip_empty = true