lefthook

package
v1.6.10 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

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

func ConfigHookCommandCompletions added in v1.5.6

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

func ConfigHookCompletions added in v1.5.6

func ConfigHookCompletions(opts *Options) []string

func Dump added in v1.4.0

func Dump(opts *Options, args DumpArgs)

func Install

func Install(opts *Options, 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

Types

type AddArgs

type AddArgs struct {
	Hook string

	CreateDirs, Force bool
}

type DumpArgs added in v1.4.1

type DumpArgs struct {
	JSON bool
	TOML bool
}

type Lefthook

type Lefthook struct {
	// Since we need to support deprecated global options Force and Aggressive
	// we need to store these fields. After their removal we need just to copy fs.
	*Options
	// 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(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 {
	Fs                afero.Fs
	Verbose, NoColors bool

	// DEPRECATED. Will be removed in 1.3.0.
	Force, Aggressive bool
}

type RunArgs added in v1.2.5

type RunArgs struct {
	NoTTY           bool
	AllFiles        bool
	FilesFromStdin  bool
	Force           bool
	Files           []string
	RunOnlyCommands []string
}

type UninstallArgs

type UninstallArgs struct {
	Force, RemoveConfig bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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