Skip to content

[DISCUSSION] Migration to prek #40

Closed
vig-os/devkit-smoke-test
#195

Description

@c-vigo

Should we migrate from pre-commit to prek?

Activity

  1. added
    feature
    on Feb 2, 2026
  2. added
    priority:backlog
    area:workflow
    and removed on Feb 18, 2026
  3. added this to the Backlog milestone on Feb 18, 2026
  4. gerchowl commented on Feb 20, 2026

    @gerchowl
    Contributor

    @c-vigo Should we target this for the 0.4 milestone, or keep it on the backlog for now?

  5. c-vigo commented on Feb 20, 2026

    @c-vigo
    ContributorAuthor

    @gerchowl backlog

  6. c-vigo commented on Jun 23, 2026

    @c-vigo
    ContributorAuthor

    Decision point surfaced by #634 (part of #625): the pre-commit cache layer is rebuilt on the Nix image, so pre-commit vs prek (both packaged in nixpkgs) is the natural choice to make there. Light reference — not superseded.

  7. c-vigo commented on Jun 24, 2026

    @c-vigo
    ContributorAuthor

    Context from the NixOS migration (#625)

    While fixing the BATS suite on the Nix toolchain (#695) we hit the broader
    problem that several pre-commit hooks cannot run on a NixOS host because their
    tools ship as generic-linux (manylinux) binaries: ruff, ruff-format, typos
    (Rust wheels) and pymarkdown (its pyjson5 C-extension needs libstdc++).
    That work is now tracked as #697 (binary hooks → flake) and #698 (pymarkdown).

    How prek relates

    prek is a runner replacement (a faster, single-binary, Python-bootstrap-free
    reimplementation of pre-commit, compatible with .pre-commit-config.yaml). It
    runs the same hook repos, so on its own it does not fix the NixOS binary
    incompatibility — a ruff/typos manylinux wheel still won't execute under
    prek on NixOS. The compatibility fix (sourcing hook tools from the flake, #697)
    is needed regardless of the runner.

    The two tracks are complementary, and there's a natural ordering:

    1. First make hooks flake-sourced / NixOS-compatible ([BUG] pre-commit: source binary hooks (ruff, ruff-format, typos) from the flake for NixOS compatibility #697, [BUG] pre-commit: make the pymarkdown hook (pyjson5 C-extension / libstdc++) run on NixOS #698). This turns
      the binary hooks into language: system hooks resolved from the dev-shell.
    2. Then prek becomes a clean swap: prek is itself a single binary
      (packaged in nixpkgs), so it drops the Python bootstrap the current runner
      needs, and it runs language: system hooks natively. Adopting prek after
      [BUG] pre-commit: source binary hooks (ruff, ruff-format, typos) from the flake for NixOS compatibility #697/[BUG] pre-commit: make the pymarkdown hook (pyjson5 C-extension / libstdc++) run on NixOS #698 is lower-risk and a bigger win (speed + one fewer Python dependency).

    Suggested next step for this issue

    Re-scope from open-ended discussion to: "Evaluate/adopt prek as the pre-commit
    runner after #697/#698 land," with a concrete spike (package prek from the
    flake, run the suite, compare wall-clock and behaviour). Could be pulled under
    #625 if we want it in the migration epic.

  8. added a commit that references this issue on Jul 3, 2026
    e67ac1b
  9. c-vigo commented on Jul 3, 2026

    @c-vigo
    ContributorAuthor

    Closed in #791

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workflowfeaturepriority:backlog

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions