Fallout-build / Fallout-build/Fallout

Adopt husky.net for contributor git hooks (dev-only, dogfood)

Open
#409 2 comments 0 reactions 0 assignees View on GitHub
dependencies enhancement target/backlog
Dominant language
C#
Stars
154
Forks
19
Avg merge
1d 22h
Merged PRs (30d)
15

Description

## Summary
Adopt [Husky.NET](https://alirezanet.github.io/Husky.Net/) as a **dev-only dependency
in this repo** to manage contributor git hooks. Scope is the Fallout repo's own
developer experience — fast feedback before commit/push. This is explicitly **not** a
framework feature and ships nothing to consumers; it touches only `.husky/`,
`Directory.Packages.props` (dev tool), and contributor docs.

## Why dogfood-only (and not a framework dependency)
Native git-hook *generation from C# build targets* — symmetric to the existing
`[GitHubActions]`/`[AzurePipelines]` generators — is the on-brand framework direction
and is tracked separately. Husky.NET overlaps with that model (its own
`task-runner.json` would be a second source of truth), so we are **not** taking it as
a framework dependency. Here it is purely a local dev-tooling convenience and a chance
to evaluate its cross-platform hook-install plumbing as prior art.

## Proposed hooks
- **commit-msg** — reject conventional-commit prefixes (`feat:`, `fix:`, `chore:`, …)
per repo rule #7. Allow the `!` breaking-change detection signal. This is a concrete,
high-value guard we currently enforce only by review.
- **pre-commit** — fast formatting check (`dotnet format --verify-no-changes` or the
build's `Format` target) on staged files.
- **pre-push** (optional) — a quick smoke (`./build.ps1 Compile`) gated to stay fast;
skip full `Test` to avoid making push painful.

## Tasks
- [ ] Add Husky.NET as a dev tool (tool manifest / `Directory.Packages.props`).
- [ ] `.husky/task-runner.json` with the hooks above; opt-in restore via
`dotnet tool restore` documented.
- [ ] commit-msg conventional-prefix guard (the headline win).
- [ ] CONTRIBUTING.md note: how hooks install, how to bypass intentionally
(`--no-verify`) when needed.
- [ ] Confirm Windows + Unix install both work (it's a cross-platform team).

## Open questions
- Auto-install on first build vs. explicit `dotnet tool restore` (avoid surprising
hook installation on clone).
- pre-push smoke in scope, or keep hooks to commit-time only for speed?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.