Skip to content

Add Nix-managed Prek hooks#132

Open
afermg wants to merge 1 commit into
cytomining:mainfrom
afermg:chore/issue-121-prek-hooks
Open

Add Nix-managed Prek hooks#132
afermg wants to merge 1 commit into
cytomining:mainfrom
afermg:chore/issue-121-prek-hooks

Conversation

@afermg

@afermg afermg commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add git-hooks.nix and treefmt-nix with Nix-pinned Ruff linting and formatting
  • generate and commit a portable .pre-commit-config.yaml pinned to the Ruff version in flake.lock
  • let both Prek and pre-commit users run the same hooks without requiring Nix
  • add nix run .#update-pre-commit-config and a flake check that detects stale generated configuration
  • install the portable hook automatically in nix develop
  • use nixos-unstable and uv sync --frozen --all-extras --dev while preserving the existing Python, CUDA, and library setup

Nix users and CI can continue using treefmt through nix fmt and nix flake check; the portable hook gives non-Nix contributors the equivalent Ruff checks.

Validation

  • nix flake check
  • nix develop --command prek run --all-files
  • nix run .#update-pre-commit-config
  • commit-time portable Prek hook

Related issue

Closes #121.

@afermg
afermg marked this pull request as draft July 15, 2026 16:24
@afermg
afermg requested a review from shntnu July 15, 2026 16:24
@afermg
afermg force-pushed the chore/issue-121-prek-hooks branch from 5d5a43a to fab7f03 Compare July 15, 2026 16:30
@afermg
afermg force-pushed the chore/issue-121-prek-hooks branch from fab7f03 to 6ae8f44 Compare July 15, 2026 16:43
@afermg
afermg marked this pull request as ready for review July 15, 2026 16:44
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.

Implement declarative ruff and ruff format linting

1 participant