From 9e5ade338c951492723e4c161a5dfa0a39f4fea7 Mon Sep 17 00:00:00 2001 From: elronbandel Date: Thu, 14 Aug 2025 14:59:14 +0300 Subject: [PATCH 1/2] Add a github action to check pre-commit is passing Signed-off-by: elronbandel --- .github/quality.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/quality.yml diff --git a/.github/quality.yml b/.github/quality.yml new file mode 100644 index 00000000..0dc87d2c --- /dev/null +++ b/.github/quality.yml @@ -0,0 +1,33 @@ +name: Verify Code Quality & Security + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }} + cancel-in-progress: true + +jobs: + quality: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Install requirements + run: | + pip install ".[dev]" + - name: Install the pre-commit hooks + run: | + pre-commit install + - name: Validate all pre-commit verification were run correctly + run: | + pre-commit run --all-files + - name: Send failure message + if: failure() # This step will only run if a previous step failed + run: echo "The quality & security verification failed. This is likely due to not using pre-commit hooks please run 'pre-commit install' before any commit." From c91977e3637a319aae54aebf0d8c85cc36f4dcac Mon Sep 17 00:00:00 2001 From: elronbandel Date: Thu, 14 Aug 2025 15:00:35 +0300 Subject: [PATCH 2/2] Add pre-commit requirement Signed-off-by: elronbandel --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c62ea1cd..84ff902d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ m = "cli.m:cli" # Use these like: # pip install -e .[dev] # pip install mellea[dev] -dev = ["mypy", "mypy-extensions", "tomli", "codespell"] +dev = ["mypy", "mypy-extensions", "tomli", "codespell", "pre-commit"] sphinx = ["sphinx_rtd_theme", "sphinx-autodoc-typehints", "sphinx_mdinclude"] [dependency-groups]