Documentation ¶
Index ¶
Constants ¶
View Source
const AddToIndexType = "add-to-index"
View Source
const CommitMessageType = "commit-message"
View Source
const ExecType = "exec"
View Source
const PrepareMessageType = "prepare-message"
View Source
const ShellScriptType = "shell-script"
View Source
const SuppressCommitFilesType = "suppress-commit-files"
View Source
const SuppressedTextType = "suppressed-text"
Variables ¶
View Source
var ( PreScripts byte = 1 Scripts byte = 2 PostScripts byte = 3 )
View Source
var CommandContext = exec.CommandContext
Functions ¶
This section is empty.
Types ¶
type AddToIndex ¶
func (*AddToIndex) Compile ¶
func (rule *AddToIndex) Compile(variables map[string]any)
func (*AddToIndex) GetPosition ¶
func (rule *AddToIndex) GetPosition() byte
type BaseRule ¶
type BaseRule struct { Type string `yaml:"type,omitempty"` Condition string `yaml:"when,omitempty"` // contains filtered or unexported fields }
func (*BaseRule) Configure ¶
func (rule *BaseRule) Configure(options ...RuleOption)
func (*BaseRule) GetCondition ¶
func (*BaseRule) GetPosition ¶
type CommandDef ¶
type CommandDef struct { Program string `yaml:"program"` Args []string `yaml:"args"` Env map[string]string `yaml:"env"` Output bool `yaml:"output"` Encoding string `yaml:"encoding"` Dir string `yaml:"dir"` }
func (*CommandDef) Compile ¶
func (c *CommandDef) Compile(variables map[string]any)
func (*CommandDef) UnmarshalYAML ¶
func (c *CommandDef) UnmarshalYAML(value *yaml.Node) error
type CommitMessage ¶
type CommitMessage struct { BaseRule `yaml:",inline"` Prefix string `yaml:"prefix"` Suffix string `yaml:"suffix"` Regexp string `yaml:"regexp"` NotEmpty bool `yaml:"not-empty"` }
func (*CommitMessage) Compile ¶
func (rule *CommitMessage) Compile(variables map[string]any)
func (*CommitMessage) Message ¶
func (rule *CommitMessage) Message() (string, error)
type Exec ¶
type Exec struct { BaseRule `yaml:",inline"` Name string `yaml:"name"` Env map[string]string `yaml:"env"` Output bool `yaml:"output"` Dir string `yaml:"dir"` Commands []CommandDef `yaml:"commands"` }
func (*Exec) GetPosition ¶
type PrepareMessage ¶
func (*PrepareMessage) Compile ¶
func (rule *PrepareMessage) Compile(variables map[string]any)
type RuleOption ¶
type RuleOption = func(rule *BaseRule)
func WithArgs ¶
func WithArgs(args []string) RuleOption
func WithCwd ¶
func WithCwd(cwd string) RuleOption
func WithEnv ¶
func WithEnv(env []string) RuleOption
WithEnv setups environment variables for BaseRule.
func WithFileSystem ¶
func WithFileSystem(fileSystem billy.Filesystem) RuleOption
func WithRepository ¶
func WithRepository(repository internal.Repository) RuleOption
type ShellScript ¶
type ShellScript struct { BaseRule `yaml:",inline"` Name string `yaml:"name"` Shell string `yaml:"shell"` Commands []string `yaml:"commands"` Env map[string]string `yaml:"env"` Encoding string `yaml:"encoding"` Output bool `yaml:"output"` Dir string `yaml:"dir"` }
func (*ShellScript) Compile ¶
func (rule *ShellScript) Compile(variables map[string]any)
func (*ShellScript) GetPosition ¶
func (rule *ShellScript) GetPosition() byte
func (*ShellScript) GetPrefix ¶
func (rule *ShellScript) GetPrefix() string
type SuppressCommitFiles ¶
type SuppressCommitFiles struct { BaseRule `yaml:",inline"` Globs []string `yaml:"globs"` RemoveFromIndex bool `yaml:"remove-from-index"` }
func (*SuppressCommitFiles) Compile ¶
func (rule *SuppressCommitFiles) Compile(variables map[string]any)
func (*SuppressCommitFiles) GetPosition ¶
func (rule *SuppressCommitFiles) GetPosition() byte
type SuppressedText ¶
type SuppressedText struct { BaseRule `yaml:",inline"` Substrings []string `yaml:"substrings"` ExcludedGlobs []string `yaml:"exclude"` }
func (*SuppressedText) Compile ¶
func (rule *SuppressedText) Compile(variables map[string]any)
func (*SuppressedText) GetPosition ¶
func (rule *SuppressedText) GetPosition() byte
Click to show internal directories.
Click to hide internal directories.