command

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvVerbose = "LEFTHOOK_VERBOSE" // keep all output

)

Variables

This section is empty.

Functions

func ShellCompleteFlags added in v2.0.11

func ShellCompleteFlags(cmd *cli.Command)

func ShellCompleteHookNames added in v2.0.11

func ShellCompleteHookNames()

Types

type AddArgs

type AddArgs struct {
	Hook string

	CreateDirs, Force bool
}

type DumpArgs

type DumpArgs struct {
	Format string
}

type InstallArgs

type InstallArgs struct {
	Force          bool
	ResetHooksPath bool
}

type Lefthook

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

func NewLefthook

func NewLefthook(verbose bool, colors string) (*Lefthook, error)

NewLefthook returns an instance of Lefthook.

func (*Lefthook) Add

func (l *Lefthook) Add(_ctx context.Context, args AddArgs) error

Add creates a hook, given in args. The hook is a Lefthook hook.

func (*Lefthook) CheckInstall

func (l *Lefthook) CheckInstall(_ctx context.Context) error

func (*Lefthook) Dump

func (l *Lefthook) Dump(_ctx context.Context, args DumpArgs) error

func (*Lefthook) Install

func (l *Lefthook) Install(ctx context.Context, args InstallArgs, hooks []string) error

func (*Lefthook) LoadConfig

func (l *Lefthook) LoadConfig() (*config.Config, error)

func (*Lefthook) Run

func (l *Lefthook) Run(ctx context.Context, args RunArgs) error

func (*Lefthook) Uninstall

func (l *Lefthook) Uninstall(_ctx context.Context, args UninstallArgs) error

func (*Lefthook) Validate

func (l *Lefthook) Validate(_ctx context.Context, args ValidateArgs) error

type RunArgs

type RunArgs struct {
	NoTTY             bool
	AllFiles          bool
	FilesFromStdin    bool
	Force             bool
	NoAutoInstall     bool
	NoStageFixed      bool
	SkipLFS           bool
	Verbose           bool
	FailOnChanges     *bool
	FailOnChangesDiff *bool
	Hook              string
	Exclude           []string
	Files             []string
	RunOnlyCommands   []string
	RunOnlyJobs       []string
	RunOnlyTags       []string
	GitArgs           []string
}

type UninstallArgs

type UninstallArgs struct {
	Force, RemoveConfig bool
}

type ValidateArgs

type ValidateArgs struct {
	SchemaPath string
}

Jump to

Keyboard shortcuts

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