lib

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Failf

func Failf(msg string, args ...interface{})

func MustRunCmd

func MustRunCmd(name string, args ...string) string

func MustRunInteractiveCmd

func MustRunInteractiveCmd(name string, args ...string)

func MustRunTestCmd

func MustRunTestCmd(msg string, name string, args ...string)

func PrintCmdLine

func PrintCmdLine(status CmdStatus, name string, colorNum int, format string, args ...interface{})

func Reformat

func Reformat(ws Workspace, executor Executor, check ReformatCheck) error

func RunCheck

func RunCheck(ws Workspace, executor Executor, check Check, err chan<- error)

func RunCmd

func RunCmd(name string, args ...string) (string, error)

func SetDebug

func SetDebug(d bool)

Types

type Check

type Check interface{}

type CmdStatus

type CmdStatus int
const (
	PASS CmdStatus = iota
	FAIL
	INFO
)

type Command

type Command struct {
	Command       string `yaml:"command"`
	Name          string `yaml:"name"`
	Description   string `yaml:"description"`
	ExpectSilence bool   `yaml:"expect_silence"`
	Number        int    `yaml:"-"`
}

type CommandExecutor

type CommandExecutor struct {
	DryRun bool
}

func (CommandExecutor) Execute

func (executor CommandExecutor) Execute(ws Workspace, cmd Command) error

Run Command returning output and error status

func (CommandExecutor) ExecuteWithOutput

func (executor CommandExecutor) ExecuteWithOutput(ws Workspace, cmd Command) ([]byte, error)

type Executor

type Executor interface {
	Execute(ws Workspace, cmd Command) error
	ExecuteWithOutput(ws Workspace, cmd Command) ([]byte, error)
}

type ManyChecks

type ManyChecks struct {
	Checks   []Check
	Parallel bool
}

type Parser

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

func NewParser

func NewParser() Parser

func (Parser) Parse

func (p Parser) Parse(check interface{}, path string) (Check, error)

type ReformatCheck

type ReformatCheck struct {
	Check  SingleCheck
	Format SingleCheck
}

type SingleCheck

type SingleCheck struct {
	Command
}

type Workspace

type Workspace struct {
	GitDir              string   // Original git directory
	WorkDir             string   // Base of the temporary directory created with git index
	RootDir             string   // Base directory of the top-level go package in the git index
	UpdatedDirs         []string // Directories that have changed and still exist (sorted)
	UpdatedTrees        []string // Top directories that have changed and still exist (sorted)
	UpdatedFiles        []string // Files that have changed and still exist
	UpdatedPackages     []string // Packages that have changed and still exist
	LocallyChangedFiles []string // Files where the git index differs from what's in the working tree
}

func Start

func Start(gitRoot string, pathSpec []string, useLndir bool) (Workspace, error)

func (Workspace) Close

func (ws Workspace) Close() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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