command

package
v1.13.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

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

)

Variables

This section is empty.

Functions

func Add

func Add(opts *Options, args *AddArgs) error

func CheckInstall added in v1.12.1

func CheckInstall(opts *Options) error

func ConfigHookCommandCompletions

func ConfigHookCommandCompletions(opts *Options, hookName string) []string

func ConfigHookCompletions

func ConfigHookCompletions(opts *Options) []string

func ConfigHookJobCompletions

func ConfigHookJobCompletions(opts *Options, hookName string) []string

func Dump

func Dump(opts *Options, args DumpArgs)

func Install

func Install(opts *Options, hooks []string, force bool) error

Install installs the hooks from config file to the .git/hooks.

func Run

func Run(opts *Options, args RunArgs, hookName string, gitArgs []string) error

func Uninstall

func Uninstall(opts *Options, args *UninstallArgs) error

func Validate

func Validate(opts *Options) error

Types

type AddArgs

type AddArgs struct {
	Hook string

	CreateDirs, Force bool
}

type DumpArgs

type DumpArgs struct {
	JSON   bool
	TOML   bool
	Format string
}

type Lefthook

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

func (*Lefthook) Add

func (l *Lefthook) Add(args *AddArgs) error

Creates a hook, given in args. The hook is a Lefthook hook.

func (*Lefthook) Install

func (l *Lefthook) Install(hooks []string, force bool) error

func (*Lefthook) Run

func (l *Lefthook) Run(hookName string, args RunArgs, gitArgs []string) error

func (*Lefthook) Uninstall

func (l *Lefthook) Uninstall(args *UninstallArgs) error

type Options

type Options struct {
	Colors            string
	Verbose, NoColors bool
}

type RunArgs

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

type UninstallArgs

type UninstallArgs struct {
	Force, RemoveConfig bool
}

Jump to

Keyboard shortcuts

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