Skip to content

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

Description

@ChrisonSimtian

Summary

Adopt 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 Add CodeQL workflow for security scanning #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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesenhancementNew feature or requesttarget/backlogNo committed release year; long-tail / demand-driven

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions