From d58ee68f61eb99a6691ed6945f93153f11bd9a37 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Sat, 4 Apr 2026 14:08:06 +0200 Subject: [PATCH] Introduce zizmor and yamlfmt (#164) --- .github/workflows/main.yml | 37 ++++++++++++++++++++++++++----------- .pre-commit-config.yaml | 10 ++++++++++ .yamlfmt.yaml | 5 +++++ 3 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 .yamlfmt.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b55fad..1a7ea54 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,11 +18,15 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: - python-version: '3.13' - enable-cache: true + persist-credentials: false + + - uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 + with: + python-version: ${{ matrix.python-version }} + enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions + - run: uv sync --frozen --all-groups - run: make lint - run: make typecheck @@ -34,11 +38,15 @@ jobs: matrix: python-version: ['3.10', '3.12', '3.13'] steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: python-version: ${{ matrix.python-version }} - enable-cache: true + enable-cache: true # zizmor: ignore[cache-poisoning] -- Job does not produce release artifacts and does not have sensitive permissions + - run: uv sync --frozen --all-groups - run: make testcov @@ -47,7 +55,7 @@ jobs: needs: [lint, test] runs-on: ubuntu-latest steps: - - uses: re-actors/alls-green@release/v1 + - uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 with: jobs: ${{ toJSON(needs) }} @@ -60,7 +68,14 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v4 - - uses: astral-sh/setup-uv@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 + with: + python-version: '3.13' + enable-cache: false + - run: uv build - - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60458dc..b2c4e3c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,16 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/google/yamlfmt + rev: v0.21.0 + hooks: + - id: yamlfmt + + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.23.1 + hooks: + - id: zizmor + - repo: local hooks: - id: lint diff --git a/.yamlfmt.yaml b/.yamlfmt.yaml new file mode 100644 index 0000000..6550b66 --- /dev/null +++ b/.yamlfmt.yaml @@ -0,0 +1,5 @@ +formatter: + type: basic + retain_line_breaks_single: true + scan_folded_as_literal: true + force_quote_style: single