From eb2d90cdc9d1bbf6c1d360b603f4c303b7ac9d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Andrei?= Date: Thu, 2 Jul 2026 17:25:57 -0300 Subject: [PATCH] Allow custom path and options to be passed to zpretty in backend-lint Add `zpretty-check-path` and `zpretty-options` inputs to the backend-lint reusable workflow so callers can override the checked path (previously hardcoded to `src`) and pass extra command-line options to zpretty. Document all backend-lint inputs in the shared-workflows reference. Refs #389 --- .github/workflows/backend-lint.yml | 10 +++++++++- docs/sources/reference/shared-workflows.md | 22 +++++++++++++++++++++- news/389.feature | 1 + 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 news/389.feature diff --git a/.github/workflows/backend-lint.yml b/.github/workflows/backend-lint.yml index f995d68c..7fea8407 100644 --- a/.github/workflows/backend-lint.yml +++ b/.github/workflows/backend-lint.yml @@ -32,6 +32,14 @@ on: required: false default: 'latest' type: string + zpretty-check-path: + required: false + default: 'src' + type: string + zpretty-options: + required: false + default: '' + type: string jobs: @@ -73,7 +81,7 @@ jobs: id: zpretty shell: bash run: | - uvx zpretty@${{ inputs.version-zpretty }} --check src + uvx zpretty@${{ inputs.version-zpretty }} --check ${{ inputs.zpretty-check-path }} ${{ inputs.zpretty-options }} - name: Check Package Metadata if: ${{ success() || failure() }} diff --git a/docs/sources/reference/shared-workflows.md b/docs/sources/reference/shared-workflows.md index b9fdf525..5b96b11a 100644 --- a/docs/sources/reference/shared-workflows.md +++ b/docs/sources/reference/shared-workflows.md @@ -80,7 +80,22 @@ steps: ### backend-lint -Runs backend linting checks. +Runs backend linting checks: `ruff` (format and lint), `zpretty` (XML / ZCML), `pyroma` (package metadata), `check-python-versions`, and optionally `mypy` (typing). + +**Inputs:** + +| Input | Description | Required | Default | +|-------|-------------|----------|---------| +| `python-version` | Python version to install | Yes | | +| `plone-version` | Plone version to install | Yes | | +| `working-directory` | Directory to run the checks in | No | `"."` | +| `check-typing` | Run `mypy` type checking on `src` | No | `false` | +| `version-ruff` | Version of `ruff` to use | No | `"latest"` | +| `version-zpretty` | Version of `zpretty` to use | No | `"latest"` | +| `version-pyroma` | Version of `pyroma` to use | No | `"latest"` | +| `version-check-python` | Version of `check-python-versions` to use | No | `"latest"` | +| `zpretty-check-path` | Path checked by `zpretty` | No | `"src"` | +| `zpretty-options` | Additional command-line options passed to `zpretty` | No | `""` | **Example usage:** @@ -88,6 +103,11 @@ Runs backend linting checks. jobs: backend-lint: uses: plone/meta/.github/workflows/backend-lint.yml@2.x + with: + python-version: "3.12" + plone-version: "6.1" + zpretty-check-path: "src" + zpretty-options: '--extend-exclude "/rss/(rss\.xml|search-rss)\.pt$"' ``` ### backend-pytest diff --git a/news/389.feature b/news/389.feature new file mode 100644 index 00000000..c80ebf36 --- /dev/null +++ b/news/389.feature @@ -0,0 +1 @@ +Added `zpretty-check-path` and `zpretty-options` inputs to the `backend-lint` reusable workflow, allowing a custom check path and additional command-line options to be passed to `zpretty`. @ericof