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
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
func (m *GitManager) Install(ctx context.Context, root reconcile.RepoRoot, opts InstallOptions) (InstallResult, error)
Install writes current managed hooks and removes legacy post-commit blocks.
type InstallOptions ¶ added in v0.2.0
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.
Click to show internal directories.
Click to hide internal directories.