hooks

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package hooks installs and checks skeeper-managed Git hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckResult added in v0.2.0

type CheckResult struct {
	OK          bool     `json:"ok"`
	Diagnostics []string `json:"diagnostics,omitempty"`
}

CheckResult reports managed hook health.

type GitManager added in v0.2.0

type GitManager struct {
	// contains filtered or unexported fields
}

GitManager is the production hook manager.

func NewManager added in v0.2.0

func NewManager(runner gitexec.Runner) *GitManager

NewManager returns a Git-backed hook manager.

func (*GitManager) Check added in v0.2.0

func (m *GitManager) Check(ctx context.Context, root reconcile.RepoRoot) (CheckResult, error)

Check validates managed hook presence and ordering.

func (*GitManager) Install added in v0.2.0

Install writes current managed hooks and removes legacy post-commit blocks.

type InstallOptions added in v0.2.0

type InstallOptions struct {
	Config config.Config
}

InstallOptions configures managed hook installation.

type InstallResult added in v0.2.0

type InstallResult struct {
	PreCommit      string   `json:"pre_commit"`
	PreMergeCommit string   `json:"pre_merge_commit"`
	PrePush        string   `json:"pre_push"`
	Gitattributes  string   `json:"gitattributes"`
	RemovedLegacy  []string `json:"removed_legacy,omitempty"`
}

InstallResult reports paths changed by hook installation.

type Manager added in v0.2.0

type Manager interface {
	Install(ctx context.Context, root reconcile.RepoRoot, opts InstallOptions) (InstallResult, error)
	Check(ctx context.Context, root reconcile.RepoRoot) (CheckResult, error)
}

Manager installs and checks managed hooks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL