From 2e73791f9518732d14f126fafe900a2ad6887981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 3 Nov 2024 08:52:56 +0100 Subject: [PATCH] chore: Sync with WeblateOrg/meta --- .github/workflows/pre-commit.yml | 18 ++++++++++++++++-- .pre-commit-config.yaml | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 03fdebb..8f10906 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -31,16 +31,30 @@ jobs: with: python-version: '3.12' - uses: astral-sh/setup-uv@v3 + - name: detect PEP 735 + id: pep735 + run: | + if grep -q dependency-groups pyproject.toml ; then + echo "found=true" >> $GITHUB_OUTPUT + else + echo "found=false" >> $GITHUB_OUTPUT + fi + - name: pre-commit + if: ${{ steps.pep735.outputs.found }} + run: uv run --only-group pre-commit pre-commit run --all + env: + RUFF_OUTPUT_FORMAT: github + REUSE_OUTPUT_FORMAT: github - name: Install dependencies + if: ${{ ! steps.pep735.outputs.found }} run: | if [ -f requirements-lint.txt ] ; then uv pip install --system -r requirements-lint.txt - elif grep -q dependency-groups pyproject.toml ; then - uv sync --only-group pre-commit else uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml) fi - name: pre-commit + if: ${{ ! steps.pep735.outputs.found }} run: pre-commit run --all env: RUFF_OUTPUT_FORMAT: github diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12b6c88..0b765f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: hooks: - id: mdformat additional_dependencies: - - mdformat-gfm==0.3.7 + - mdformat-gfm==0.3.6 - mdformat-ruff==0.1.3 - - mdformat-shfmt==0.2.0 + - mdformat-shfmt==0.1.0 - mdformat_tables==1.0.0