From b09bdeae27a4f065af19328ee452c54092c6410a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Wed, 16 Oct 2024 21:39:34 -0700 Subject: [PATCH] Fix GitHub action warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .github/workflows/pyproject_fmt_build.yaml | 24 ++++++++-------------- .pre-commit-config.yaml | 6 ++++++ 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pyproject_fmt_build.yaml b/.github/workflows/pyproject_fmt_build.yaml index 2a8f659..6aacc58 100644 --- a/.github/workflows/pyproject_fmt_build.yaml +++ b/.github/workflows/pyproject_fmt_build.yaml @@ -41,9 +41,7 @@ jobs: crate: cargo-edit - uses: actions/checkout@v4 - name: Bump version - run: - cargo set-version -p pyproject-fmt --bump '${{ github.event.inputs.release == 'no' || - github.event.inputs.release == null && 'patch' || github.event.inputs.release }}' + run: cargo set-version -p pyproject-fmt --bump '${{ github.event.inputs.release == 'no' || github.event.inputs.release == null && 'patch' || github.event.inputs.release }}' - name: Install the latest version of uv uses: astral-sh/setup-uv@v3 with: @@ -51,12 +49,12 @@ jobs: cache-dependency-glob: "tasks/changelog.py" - name: Generate changelog id: get-version - run: - uv run tasks/changelog.py pyproject-fmt "${{ github.event.number }}" "${{ github.event.pull_request.base.sha - }}" + run: uv run tasks/changelog.py pyproject-fmt "${{ github.event.number }}" "${{ github.event.pull_request.base.sha }}" env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - uses: actions/setup-python@v5 + with: + python-version: "3.13" - uses: pre-commit/action@v3.0.1 continue-on-error: true - name: Show changes to the repository @@ -106,9 +104,7 @@ jobs: with: target: ${{ matrix.platform.target }} - args: - -m pyproject-fmt/Cargo.toml --release --out dist --interpreter ${{ matrix.platform.interpreter || '3.8' }} - --target-dir target + args: -m pyproject-fmt/Cargo.toml --release --out dist --interpreter ${{ matrix.platform.interpreter || '3.8' }} --target-dir target sccache: "true" manylinux: ${{ matrix.platform.manylinux || 'auto' }} - name: Upload wheels @@ -137,9 +133,7 @@ jobs: with: target: ${{ matrix.platform.target }} - args: - -m pyproject-fmt/Cargo.toml --release --out dist --interpreter ${{ matrix.platform.interpreter || '3.8' }} - --target-dir target + args: -m pyproject-fmt/Cargo.toml --release --out dist --interpreter ${{ matrix.platform.interpreter || '3.8' }} --target-dir target sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -167,9 +161,7 @@ jobs: with: target: ${{ matrix.platform.target }} - args: - -m pyproject-fmt/Cargo.toml --release --out dist --interpreter "3.8 pypy3.8 pypy3.9 pypy3.10" --target-dir - target + args: -m pyproject-fmt/Cargo.toml --release --out dist --interpreter "3.8 pypy3.8 pypy3.9 pypy3.10" --target-dir target sccache: "true" - name: Upload wheels uses: actions/upload-artifact@v4 @@ -206,7 +198,7 @@ jobs: permissions: id-token: write contents: write - if: github.event.inputs.release != 'no' && github.event.inputs.release != null && github.ref == 'main' + if: github.event.inputs.release != 'no' && github.event.inputs.release != null && github.ref == 'refs/heads/main' needs: [linux, windows, macos, sdist, bump] steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2e7c0eb..b686b94 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,13 @@ repos: rev: "v3.3.3" hooks: - id: prettier + name: Prettier non-workflow files args: ["--print-width=120", "--prose-wrap=always"] + exclude: ".github/workflows/" + - id: prettier + name: Prettier workflow files + args: ["--print-width=240", "--prose-wrap=always"] + exclude: "^(?!.github/workflows/)" - repo: meta hooks: - id: check-hooks-apply