Skip to content

Migrate linting CI from pre-commit to prek#151

Merged
edmundmiller merged 2 commits into
mainfrom
claude/prek-migration
Jun 17, 2026
Merged

Migrate linting CI from pre-commit to prek#151
edmundmiller merged 2 commits into
mainfrom
claude/prek-migration

Conversation

@edmundmiller

Copy link
Copy Markdown
Contributor

Summary

Migrate the linting CI from pre-commit to prek — a faster, single-binary, drop-in reimplementation of pre-commit written in Rust.

prek reads the existing .pre-commit-config.yaml and runs the same hooks, so the config is kept unchanged and contributors can still use pre-commit locally if they prefer. No prek.toml, no forced tooling change.

Changes

  • .github/workflows/pre-commit.yml — replace actions/setup-python + pip install pre-commit + pre-commit run --all-files with j178/prek-action (which runs prek run --all-files).
  • .github/workflows/fix-linting.yml (the @nf-core-bot fix linting autofix) — install prek via the action (install-only: true) and run prek run --all-files, preserving the continue-on-error outcome that drives the commit/react logic.
  • Kept the pre-commit job name so any required-status-check branch protection keeps matching.
  • prek-action is pinned to a commit SHA (v2.0.4) to match the repo's other pinned actions.

Why

  • Faster CI and no Python bootstrap step.
  • Drop-in: same .pre-commit-config.yaml, same hooks (prettier, editorconfig-checker, actionlint).

Notes

https://claude.ai/code/session_01DGsyWUGbsvfkJDgdcaYLxv


Generated by Claude Code

Use the prek-action (a faster, drop-in reimplementation of pre-commit) in
both the lint check and the @nf-core-bot autofix workflow. prek reads the
existing .pre-commit-config.yaml and runs the same hooks, so the config is
kept unchanged and contributors can still run pre-commit locally.

- pre-commit.yml: replace setup-python + pip install pre-commit with
  j178/prek-action (runs prek run --all-files).
- fix-linting.yml: install prek via the action (install-only) and run it,
  preserving the continue-on-error outcome that drives the commit/react logic.
- Keep the 'pre-commit' job name so required-status-check protection is
  unaffected.

Addresses #150 (CI swap, keeping .pre-commit-config.yaml).
Comment thread .github/workflows/fix-linting.yml Outdated
Comment on lines 40 to 43
- name: Run prek
id: prek
run: prek run --all-files
continue-on-error: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed if we run the setup step without the added install-only

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — done in 9f456e2. Dropped install-only and the separate run step; the action now runs prek run --all-files directly with id: prek + continue-on-error, so the existing steps.prek.outcome autofix/commit logic is unchanged.


Generated by Claude Code

Address review feedback: drop the install-only + separate run step and let
j178/prek-action run prek run --all-files itself, with id + continue-on-error
driving the existing autofix/commit logic.
@edmundmiller edmundmiller merged commit 4737a53 into main Jun 17, 2026
2 checks passed
@edmundmiller edmundmiller deleted the claude/prek-migration branch June 17, 2026 17:29
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.

Migrate CI linting from pre-commit to prek

3 participants