Documentation
¶
Index ¶
- func InitScaffold(repoRoot string) ([]string, error)
- type Bundle
- func (b Bundle) CheckBranch(branch string, skipPolicy bool) error
- func (b Bundle) CheckCommitMessage(message string, skipPolicy bool) error
- func (b Bundle) IsProtectedBranch(branch string) bool
- func (b Bundle) MatchesSensitivePath(path string) bool
- func (b Bundle) ValidateBranch(branch string) error
- func (b Bundle) ValidateCommitMessage(message string) error
- func (b Bundle) ValidatePush(branch string, override bool) error
- func (b Bundle) WarnCommitMessage(message string) error
- type CommitSettings
- type Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitScaffold ¶
InitScaffold writes default team config files if missing.
Types ¶
type Bundle ¶
type Bundle struct {
RepoRoot string
Policy Policy
Commit CommitSettings
}
Bundle contains repository-local fastgit settings.
func (Bundle) CheckBranch ¶
CheckBranch returns a blocking error when enforce is on and the branch violates policy.
func (Bundle) CheckCommitMessage ¶
CheckCommitMessage returns a blocking error when enforce is on and the message violates policy.
func (Bundle) IsProtectedBranch ¶
IsProtectedBranch reports whether direct pushes should be blocked.
func (Bundle) MatchesSensitivePath ¶
MatchesSensitivePath reports whether a path should trigger extra review.
func (Bundle) ValidateBranch ¶
ValidateBranch checks the current branch against policy.
func (Bundle) ValidateCommitMessage ¶
ValidateCommitMessage checks a message against policy and commit settings.
func (Bundle) ValidatePush ¶
ValidatePush blocks direct pushes to protected branches unless override is set.
func (Bundle) WarnCommitMessage ¶
WarnCommitMessage returns validation issues when enforce is off.
type CommitSettings ¶
type CommitSettings struct {
Locale string `yaml:"locale"`
MaxLength int `yaml:"max_length"`
RequireScope bool `yaml:"require_scope"`
CandidatesDefault bool `yaml:"candidates_default"`
Types []string `yaml:"types"`
}
CommitSettings defines AI commit generation preferences.
type Policy ¶
type Policy struct {
Enforce bool `yaml:"enforce"`
Branch struct {
Pattern string `yaml:"pattern"`
} `yaml:"branch"`
ProtectedBranches []string `yaml:"protected_branches"`
Commit struct {
Conventional bool `yaml:"conventional"`
} `yaml:"commit"`
SensitivePaths []string `yaml:"sensitive_paths"`
}
Policy defines team governance rules for a repository.