From ca0dc0f012f8dc9932ab3242b6e32c193644cd28 Mon Sep 17 00:00:00 2001 From: Alvaro Cea Date: Tue, 10 Sep 2024 08:25:51 +0100 Subject: [PATCH] add initial support for Github actions and pre-commit --- .github/workflows/tests.yaml | 14 ++++++++++++++ .pre-commit-config.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/tests.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..276844f --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,14 @@ +steps: +- uses: actions/checkout@v4 +- name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' +- name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt +- name: Test with pytest + run: | + pip install pytest pytest-cov + pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..421108f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +# To install the git pre-commit hooks run: +# pre-commit install --install-hooks +# To update the versions: +# pre-commit autoupdate +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.6.4 + hooks: + # Run the linter. + - id: ruff + args: [--fix, --show-fixes] + # Run the formatter. + - id: ruff-format +- repo: https://github.com/tox-dev/pyproject-fmt + rev: "1.5.2" + hooks: + - id: pyproject-fmt +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + exclude: '.*\.pth$' + - id: debug-statements