Enforce pre-commit in CI#470
Merged
Merged
Conversation
3 tasks
d622067 to
7205a89
Compare
ianpittwood
approved these changes
Apr 24, 2026
7205a89 to
d049c32
Compare
d049c32 to
964bc47
Compare
Adds a `lint` job to ci.yml that runs pre-commit on every push/PR/
merge_group, gated by the meta `ci` job's `needs:` so failures block
merges. Inline job with SHA-pinned actions (actions/checkout@v6.0.2,
actions/setup-python@v5.6.0, pre-commit/action@v3.0.1),
`permissions: contents: read`, and `persist-credentials: false` on
checkout.
Pre-commit hooks added:
- pre-commit/pre-commit-hooks v6.0.0 (check-added-large-files,
check-ast, check-case-conflict, check-executables-have-shebangs,
check-json, check-merge-conflict, check-shebang-scripts-are-
executable, check-yaml, debug-statements, detect-aws-credentials,
detect-private-key, end-of-file-fixer, fix-byte-order-marker,
mixed-line-ending, no-commit-to-branch, pretty-format-json,
requirements-txt-fixer, trailing-whitespace)
- koalaman/shellcheck-precommit v0.11.0
- scop/pre-commit-shfmt v3.13.1-1
- astral-sh/ruff-pre-commit v0.15.10
- rhysd/actionlint v1.7.12
Config changes:
- Replace beautysh (unmaintained, broken on Python 3.12) with shfmt
- Exclude .claude/settings.json from pretty-format-json
- Remove commented-out mypy block
- Add .github/actionlint.yaml registering the `ubuntu-latest-8x`
org-hosted larger runner label
Fixes to make actionlint pass on current source:
- Quote `>> $GITHUB_OUTPUT` / `>> $GITHUB_PATH` in workflow run: blocks
- `./*-metadata.json` instead of `*-metadata.json` in bakery ci merge
(SC2035 glob safety)
- Consolidate multiple `echo >> $GITHUB_OUTPUT` redirects into a
single `{ ... } >> "$GITHUB_OUTPUT"` block (SC2129)
- Quote `$IMAGES` in product-release.yml release-body construction
- Replace word-splitting of optional flag strings with bash arrays in
clean.yml and bakery-build-pr.yml (`"${FLAGS[@]}"` idiom)
Also applies ruff-format + end-of-file-fixer to pre-existing drifted
files so the new CI job passes on current source. No behavior change.
README: new Contributing section pointing contributors at `just setup`
to install the hooks locally.
964bc47 to
2cb21f3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lintjob toci.ymlthat runs pre-commit on every push/PR/merge_group, gated by the metacijob'sneeds:list so hook failures block mergesbeautysh→shfmtin.pre-commit-config.yaml(beautysh is unmaintained and broken on Python 3.12)actions/checkout@v6.0.2,actions/setup-python@v5.6.0,pre-commit/action@v3.0.1;permissions: contents: read;SKIP: no-commit-to-branchenvNo reusable workflow — the job is small enough that inlining avoids cross-repo merge-order dependencies.
Test plan
pre-commit run --all-filespasses locally on this branchlintjob in CI passes on this PR