repoconfig

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitScaffold

func InitScaffold(repoRoot string) ([]string, error)

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 Load

func Load(repoRoot string) (Bundle, error)

Load reads `.fastgit/policy.yaml` and `.fastgit/commit.yaml` when present.

func (Bundle) CheckBranch

func (b Bundle) CheckBranch(branch string, skipPolicy bool) error

CheckBranch returns a blocking error when enforce is on and the branch violates policy.

func (Bundle) CheckCommitMessage

func (b Bundle) CheckCommitMessage(message string, skipPolicy bool) error

CheckCommitMessage returns a blocking error when enforce is on and the message violates policy.

func (Bundle) IsProtectedBranch

func (b Bundle) IsProtectedBranch(branch string) bool

IsProtectedBranch reports whether direct pushes should be blocked.

func (Bundle) MatchesSensitivePath

func (b Bundle) MatchesSensitivePath(path string) bool

MatchesSensitivePath reports whether a path should trigger extra review.

func (Bundle) ValidateBranch

func (b Bundle) ValidateBranch(branch string) error

ValidateBranch checks the current branch against policy.

func (Bundle) ValidateCommitMessage

func (b Bundle) ValidateCommitMessage(message string) error

ValidateCommitMessage checks a message against policy and commit settings.

func (Bundle) ValidatePush

func (b Bundle) ValidatePush(branch string, override bool) error

ValidatePush blocks direct pushes to protected branches unless override is set.

func (Bundle) WarnCommitMessage

func (b Bundle) WarnCommitMessage(message string) error

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.

Jump to

Keyboard shortcuts

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