Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/backend-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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() }}
Expand Down
22 changes: 21 additions & 1 deletion docs/sources/reference/shared-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,34 @@ 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:**

```yaml
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
Expand Down
1 change: 1 addition & 0 deletions news/389.feature
Original file line number Diff line number Diff line change
@@ -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