Skip to content

[pre-commit.ci] pre-commit autoupdate#267

Merged
gaborbernat merged 3 commits into
mainfrom
pre-commit-ci-update-config
May 27, 2026
Merged

[pre-commit.ci] pre-commit autoupdate#267
gaborbernat merged 3 commits into
mainfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci
Copy link
Copy Markdown
Contributor

@pre-commit-ci pre-commit-ci Bot commented May 25, 2026

gaborbernat added a commit to gaborbernat/pyproject-api that referenced this pull request May 27, 2026
Adding zizmor to pre-commit catches GitHub Actions security issues
automatically. Running it against existing workflows exposed several
supply chain and privilege escalation risks that needed fixing rather
than suppressing.

Pin all action references to commit SHAs so tag mutations by upstream
maintainers cannot redirect CI to malicious code. Add workflow-level
`permissions: {}` as a deny-all baseline with explicit per-job grants,
preventing privilege escalation if a compromised action tries to use
inherited GITHUB_TOKEN permissions. Disable uv caching in
push-triggered workflows to close the cache-poisoning vector. Add
`persist-credentials: false` to checkout steps so the token is not
unnecessarily retained in the git config after checkout.

Also bumps all other pre-commit hook versions as proposed in PR tox-dev#267.
Adding zizmor to pre-commit catches GitHub Actions security issues
automatically. Running it against existing workflows exposed several
supply chain and privilege escalation risks that needed fixing rather
than suppressing.

Pin all action references to commit SHAs so tag mutations by upstream
maintainers cannot redirect CI to malicious code. Add workflow-level
`permissions: {}` as a deny-all baseline with explicit per-job grants,
preventing privilege escalation if a compromised action tries to use
inherited GITHUB_TOKEN permissions. Disable uv caching in
push-triggered workflows to close the cache-poisoning vector. Add
`persist-credentials: false` to checkout steps so the token is not
unnecessarily retained in the git config after checkout.

Also bumps all other pre-commit hook versions as proposed in PR #267.
The project migrated from mypy to ty, but several type: ignore comments
used mypy-specific error codes (list-item, return-value, attr-defined)
that ty does not recognise, causing the type check to fail.

For the intentional bad-return test fixtures in build.py, the mypy
codes are dropped in favour of bare type: ignore, which both tools
honour. For the metadata lookup in test_frontend_setuptools.py, the
workaround is removed entirely by switching from the untyped .items()
to .get_all(), which is the correct PackageMetadata API and resolves
the attribute error without any suppression.
@gaborbernat
Copy link
Copy Markdown
Member

Superseded: ruff v0.15.14 already in main along with broader security hardening (zizmor, SHA-pinned actions, permissions).

@gaborbernat gaborbernat reopened this May 27, 2026
@gaborbernat gaborbernat force-pushed the pre-commit-ci-update-config branch from 958e6de to 75e0ff9 Compare May 27, 2026 17:40
ruff v0.15.14 adds PLW0717 which flags try clauses with more than 5
statements. Collapse the redundant intermediate variable into a single
assignment to drop from 6 to 5 statements.
@gaborbernat gaborbernat merged commit 2c135a8 into main May 27, 2026
26 checks passed
@gaborbernat gaborbernat deleted the pre-commit-ci-update-config branch May 27, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant