From d2ed280d70f798c8a78c253851309d44db260517 Mon Sep 17 00:00:00 2001 From: ariwk Date: Tue, 22 Oct 2024 21:36:33 +0200 Subject: [PATCH] chore: add tox.ini --- sonar-project.properties | 21 +++++++++++++++++++++ tox.ini | 28 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 sonar-project.properties create mode 100644 tox.ini diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..287fec3 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,21 @@ +sonar.projectKey=SchweizerischeBundesbahnen_open-source-polarion-python-repo-template +sonar.organization=schweizerischebundesbahnen + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=python-requirements-inspector +#sonar.projectVersion=1.0 + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +sonar.sources=open-source-polarion-python-repo-template + +# Encoding of the source code. Default is default system encoding +sonar.sourceEncoding=UTF-8 + +# Additional parameters +sonar.python.xunit.reportPaths=junittest.xml +sonar.python.coverage.reportPaths=coverage.xml +#sonar.branch.target = main +#sonar.test.exclusions=tests/** +#sonar.tests=tests/ +sonar.python.version=3.12 +sonar.qualitygate.wait=true diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..d63132d --- /dev/null +++ b/tox.ini @@ -0,0 +1,28 @@ +[tox] +isolated_build = True +envlist = + lint + py312 + +[testenv:lint] +deps = + ruff + mypy +commands = + ruff format + ruff check + mypy . + +[testenv] +deps = + coverage + pytest +commands = + coverage run -m pytest . --junitxml="junittest.xml" + coverage report -m --fail-under 90 + coverage xml + +[coverage:run] +relative_files = True +source = open_source_polarion_python_repo_template/ +branch = True