From f13634948c648498774c527f5eb967ce6192ef56 Mon Sep 17 00:00:00 2001 From: Salomon Popp Date: Mon, 8 Apr 2024 12:46:14 +0200 Subject: [PATCH] Ensure Poetry check using pre-commit (#6) --- .github/workflows/ci.yaml | 5 ++++- .pre-commit-config.yaml | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bcb8ae1..ef5fd4c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,6 +20,7 @@ jobs: python-version: ["3.10", "3.11", "3.12"] defaults: run: + shell: bash working-directory: ${{ env.working-directory }} steps: @@ -32,11 +33,13 @@ jobs: poetry-version: ${{ env.poetry-version }} working-directory: ${{ env.working-directory }} + - name: Check Poetry config and lockfile + run: poetry run pre-commit run poetry-check --all-files + - name: Install dependencies run: poetry install --no-interaction - name: Lint (ruff) - shell: bash run: | if [[ "$RUNNER_OS" == "Linux" && "${{ matrix.python-version }}" == "3.10" ]] then diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8fa2458..0148e9d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,13 @@ repos: - repo: local hooks: + - id: poetry-check + name: poetry-check + description: validate Poetry config and dependency lockfile + entry: poetry check + language: python + pass_filenames: false + files: ^(.*/)?(pyproject\.toml|poetry\.lock)$ - id: ruff-lint name: ruff-lint entry: ruff check