Skip to content

Implement pre-commit hooks across all PSModule repos #40

@MariusStorhaug

Description

Context

We have documented pre-commit hooks as a practice under the Shift Left principle in the Ways of Working. Pre-commit hooks close the gap between "I can test locally if I choose to" and "it is always checked before it leaves my machine."

We need to implement this consistently across the entire PSModule repo structure.

What needs to happen

  • Decide on a pre-commit framework (e.g. pre-commit, Git hooks via Husky, or a PowerShell-native solution)
  • Define the standard set of gates to run on commit:
    • Linting / formatting (e.g. PSScriptAnalyzer)
    • Static analysis
    • Secret scanning
    • Fast unit tests (optional — only if sub-second)
  • Create a shared, reusable hook configuration that can be adopted by all repos
  • Roll out to all active PSModule repos
  • Document setup steps in the Ways of Working / developer onboarding docs

Acceptance criteria

  • Every PSModule repo has a pre-commit hook configuration checked in at the repo root
  • A new contributor can enable hooks with a single command after cloning
  • The hooks run in under a few seconds to avoid bypassing pressure
  • The hook configuration is the same (or composable from a shared base) across repos

Metadata

Metadata

Assignees

No one assigned

    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