Skip to content

Migrate CI linting from pre-commit to prek #150

Closed

Description

@edmundmiller

Summary

Follow-up from #149 (which touched .github/workflows/pre-commit.yml). Migrate the linting CI from pre-commit to prek — a fast Git-hook manager written in Rust, designed as a drop-in alternative to pre-commit.

Why

  • Faster — several times quicker than pre-commit in CI.
  • No Python runtime needed — prek is a single self-contained binary, so the actions/setup-python + pip install pre-commit steps go away.
  • Compatible — it reads the existing .pre-commit-config.yaml and runs the same hooks (prettier, editorconfig-checker, actionlint), and also supports a native prek.toml.
  • Less disk usage; shared toolchain installs across hooks.

Scope / checklist

  • Convert the config to prek's native format:
    prek util yaml-to-toml   # .pre-commit-config.yaml -> prek.toml
    ⚠️ YAML comments are not preserved during conversion. Our current .pre-commit-config.yaml has no comments, so nothing is lost — but re-add any if some are introduced before the migration lands.
  • Decide the fate of .pre-commit-config.yaml:
    • Replace it with prek.toml (cleanest), or
    • keep both if we still want contributors to be able to run plain pre-commit locally. Note pre-commit cannot read prek.toml, so going toml-only means local hook runs require prek.
  • Update .github/workflows/pre-commit.yml to use the official action (drop setup-python + pip install):
    - uses: actions/checkout@v4
    - uses: j178/prek-action@v2
  • Confirm all three hooks still run and pass under prek (prettier, editorconfig-checker, actionlint).
  • Update contributor docs / README to mention prek install / prek run --all-files.
  • Optional: pin prek-action to a commit SHA to match the repo's other pinned actions.

References

Tooling/CI chore — not a pipeline/RFC/SIG proposal, so it is intentionally outside the approval-automation flow.

Activity

  1. self-assigned this
    on Jun 16, 2026
  2. edmundmiller commented on Jun 16, 2026

    @edmundmiller
    ContributorAuthor

    Implemented in #149 (commit 8d07e8c).

    Decision: went with swap CI to prek, keep .pre-commit-config.yaml rather than the toml-only / prek-required route — prek reads the existing config, so contributors can keep using pre-commit locally and nothing else in the org breaks.

    What changed:

    • pre-commit.yml now uses j178/prek-action@v2.0.4 (dropped setup-python + pip install pre-commit).
    • fix-linting.yml installs prek (install-only) and runs prek run --all-files, preserving the autofix/commit logic.
    • .pre-commit-config.yaml left unchanged; pre-commit job name kept so required-status-check protection is unaffected.

    The prek util yaml-to-toml → prek.toml conversion is intentionally not done, to keep pre-commit compatibility. Leaving this issue open until #149 merges; can revisit going toml-only if the org adopts prek more broadly.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions