Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019dpKwZWtahQU4V2NhpVmLt
39 lines
1.0 KiB
Nix
39 lines
1.0 KiB
Nix
# Git hooks. The checks themselves live in dev/hooks/ (shared with the Nix
|
|
# flake checks in nix/checks.nix); this file only wires them into git-hooks.
|
|
# Hooks install when a devenv shell is entered. See docs/hooks.md.
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
packages = [
|
|
pkgs.taplo
|
|
pkgs.yamllint
|
|
pkgs.shellcheck
|
|
pkgs.markdownlint-cli
|
|
pkgs.nushell
|
|
];
|
|
|
|
git-hooks.hooks = {
|
|
# Fast: fmt, clippy (Rust files only), lint, secret scan.
|
|
slinuxm-pre-commit = {
|
|
enable = true;
|
|
name = "slinuxm pre-commit";
|
|
entry = "dev/hooks/run.sh pre-commit";
|
|
language = "system";
|
|
pass_filenames = false;
|
|
always_run = true;
|
|
stages = [ "pre-commit" ];
|
|
};
|
|
# Path-filtered tests and slow checks. Skip one run with
|
|
# SKIP=slinuxm-pre-push git push (pre-commit framework variable).
|
|
slinuxm-pre-push = {
|
|
enable = true;
|
|
name = "slinuxm pre-push";
|
|
entry = "dev/hooks/run.sh pre-push";
|
|
language = "system";
|
|
pass_filenames = false;
|
|
always_run = true;
|
|
stages = [ "pre-push" ];
|
|
};
|
|
};
|
|
}
|