Skip to content

Make git hooks a mandatory part of the org shell - #46

Merged
andrewthomaslee merged 1 commit into
mainfrom
git-hooks-mandatory
Nov 26, 2026
Merged

andrewthomaslee merged 1 commit into
mainfrom
git-hooks-mandatory

Conversation

@andrewthomaslee

Copy link
Copy Markdown
Member

What

  • devenv/devenv.nix: the fmt pre-commit hook is always on. I removed the hasGitHooks opt-in guard and the shell-entry note. A repo without the git-hooks input can no longer enter the shell.

  • flakeModules/dev.nix: new checks.git-hooks in flakeModules.default. For any repo with a devenv shell, it fails when:

    • devenv.lock has no git-hooks input
    • git-hooks doesn't follow org-pkgs/git-hooks
    • .gitignore doesn't list .pre-commit-config.yaml

    The message includes the fix. devenv's own error suggests --follows nixpkgs, which is wrong for the org.

  • Docs (flake-standard.md, README) and the template comment now say "always" instead of "opt in". They also give the order for moving a repo to this pkgs, and mention the claude guard (modules gitHookGuard).

Why

The owner wants git hooks to be part of the org standard with no opt-out, the same as the devenv shell.

Checks

  • fmt: clean. check: all checks passed, incl. the new git-hooks check on pkgs itself.
  • Negative test: without the .gitignore line, checks.git-hooks fails with:
    The org git hooks are not set up:
      - .gitignore does not list .pre-commit-config.yaml
    Fix: in devenv.yaml under inputs add …
    

Rollout (follow-up PRs, each bumps org-pkgs to this)

skills, modules, home, clanServices, not-secrets, then secrets, and explain-kube-to-me. azure-infra, presenting and gitops are left as they are, per the owner.

🤖 Generated with Claude Code

Every org repo has the git hooks, the same way it has the devenv shell:
the org shell enables the fmt hook unconditionally (no opt-in guard, no
note), and the new checks.git-hooks in flakeModules.default fails CI
when a repo with a devenv shell lacks `git-hooks.follows:
org-pkgs/git-hooks` in devenv.yaml or `.pre-commit-config.yaml` in
.gitignore, with the fix in the message (devenv's own error suggests
following nixpkgs, which is wrong here).

Docs and the template say "always" instead of "opt in".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrewthomaslee
andrewthomaslee enabled auto-merge (squash) November 26, 2026 11:46
@andrewthomaslee
andrewthomaslee merged commit 0347d95 into main Nov 26, 2026
3 checks passed
andrewthomaslee added a commit to external-systems/not-secrets that referenced this pull request Nov 26, 2026
Git hooks are a mandatory part of the org standard
(external-systems/pkgs#46): the org shell runs fmt on every commit and
checks.git-hooks fails CI without them.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
andrewthomaslee added a commit to external-systems/skills that referenced this pull request Nov 26, 2026
Git hooks are a mandatory part of the org standard
(external-systems/pkgs#46): the org shell runs fmt on every commit and
checks.git-hooks fails CI without them.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
andrewthomaslee added a commit to external-systems/clanServices that referenced this pull request Nov 26, 2026
Git hooks are a mandatory part of the org standard
(external-systems/pkgs#46): the org shell runs fmt on every commit and
checks.git-hooks fails CI without them.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
andrewthomaslee added a commit to external-systems/explain-kube-to-me that referenced this pull request Nov 26, 2026
Git hooks are a mandatory part of the org standard
(external-systems/pkgs#46): the org shell runs fmt on every commit and
checks.git-hooks fails CI without them.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
andrewthomaslee added a commit to external-systems/modules that referenced this pull request Nov 26, 2026
Git hooks are a mandatory part of the org standard
(external-systems/pkgs#46).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
andrewthomaslee added a commit to external-systems/home that referenced this pull request Nov 26, 2026
## What
- `org-pkgs` bumped to 0347d95 with `sync-locks`. On that pkgs, git
hooks are a mandatory part of the org standard and `checks.git-hooks`
enforces it (external-systems/pkgs#46).
- `modules` bumped (external-systems/modules#56; brings skills#26).
- `secrets` bumped (external-systems/secrets#11, lock updates only).
- home already had the hooks (`devenv.yaml` follows, `.gitignore`, the
`clan vars check` pre-push hook), so this PR changes lockfiles only.

## Checks
- `nix flake update org-pkgs modules secrets`, `nix run .#sync-locks`,
`devenv shell -- true`, `fmt`, then `check`: all checks passed,
including `git-hooks`. `clan vars check`: all vars present and valid for
all 6 machines.
- The commit went through `fmt` (pre-commit) and the push through `clan
vars check` (pre-push). Both passed.

## Reviewer notes
No machine changes on merge; the profile changes from modules reach
machines only with a deploy, which is your call.

## Merge order
Last. pkgs#46, skills#26, clanServices#39, not-secrets#10,
explain-kube-to-me#8, modules#56 and secrets#11 are all merged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@andrewthomaslee
andrewthomaslee deleted the git-hooks-mandatory branch November 29, 2026 16:20
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.

1 participant