Skip to content

Wire existing validation into local pre-commit hooks #13

Open

Description

Describe the change

Let organization-default contributors run the existing validation before committing, with meaningful checks of the staged content rather than a pass over unrelated committed files. The repository has no .pre-commit-config.yaml; MSXOrg/.github#12 intentionally delivers only the separately approved read-only PR check for #11. The MSX Pre-Commit standard requires local hooks for repositories holding code, so local onboarding remains a captured standards exception.

This issue records a separate follow-up, not authorization for a repository-wide language/tooling rollout, live ruleset changes, or hook writes into another worktree's checkout. An owner must confirm the bounded hook scope and safe installation mechanism before implementation begins.

Acceptance criteria

  • A contributor can run the existing applicable checks before a commit and receives a nonzero result for deliberately malformed staged Markdown or fallback content.
  • Staged changes are actually examined; a clean committed HEAD, unrelated fixtures, or no applicable input cannot disguise unvalidated staged content.
  • Local and hosted checks use the same approved shared rule configuration, with explicit version/tool setup and no duplicated formatting rules.
  • Installing a hook does not silently change another app-managed worktree or the main checkout.
  • Valid and malformed anonymous fixtures demonstrate the rejection and correction paths, and direct contributor documentation explains setup and the exact local command.

Technical decisions

Reuse the source-bound validator, Pester suite, and configurations under .github/scripts, .github/tests, and .github/linters. Keep the organization-defaults scope and the existing read-only hosted workflow; do not add release tooling, consumer rollout, label mutation, or live enforcement. The existing Test-OrganizationDefaults.ps1 compares committed revisions, so the staged-input adapter and per-worktree installation approach need explicit owner review before this Task is ready.

Implementation plan

  • Resolve the hook scope and safe isolated-checkout/worktree installation design with the owner.
  • Define failing anonymous staged-versus-committed and malformed-versus-valid tests before changing hook behavior.
  • Add the minimum .pre-commit-config.yaml and staged-input wiring using the existing approved tooling.
  • Document setup and exact commands without changing unrelated organization-fallback guidance.
  • Verify the staged rejection/correction cases, hosted parity, and complete current-head review in one separately scoped pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions