validate

package
v14.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package validate provides functionality to validate the status of Git repositories. These validators are used mostly inside Cobra commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config added in v14.2.1

func Config(args ConfigArgs) (config.ValidatedConfig, bool, error)

func HandleUnfinishedState

func HandleUnfinishedState(args UnfinishedStateArgs) (bool, error)

HandleUnfinishedState checks for unfinished state on disk, handles it, and signals whether to continue execution of the originally intended steps.

func HasAcceptableGitVersion

func HasAcceptableGitVersion(majorVersion, minorVersion int) error

HasAcceptableGitVersion verifies that the system has Git of version 2.7 or newer installed.

func IsAcceptableGitVersion

func IsAcceptableGitVersion(major, minor int) bool

IsAcceptableGitVersion indicates whether the given Git version works for Git Town.

func NoOpenChanges

func NoOpenChanges(hasOpenChanges bool) error

Types

type ConfigArgs added in v14.2.1

type ConfigArgs struct {
	Backend            gitdomain.RunnerQuerier
	BranchesSnapshot   gitdomain.BranchesSnapshot
	BranchesToValidate gitdomain.LocalBranchNames
	DialogTestInputs   components.TestInputs
	Frontend           gitdomain.Runner
	Git                git.Commands
	LocalBranches      gitdomain.LocalBranchNames
	RepoStatus         gitdomain.RepoStatus
	TestInputs         components.TestInputs
	Unvalidated        config.UnvalidatedConfig
}

type UnfinishedStateArgs

type UnfinishedStateArgs struct {
	Backend           gitdomain.RunnerQuerier
	CommandsCounter   gohacks.Counter
	Connector         Option[hostingdomain.Connector]
	DialogTestInputs  components.TestInputs
	FinalMessages     stringslice.Collector
	Frontend          gitdomain.Runner
	Git               git.Commands
	HasOpenChanges    bool
	PushHook          configdomain.PushHook
	RepoStatus        gitdomain.RepoStatus
	RootDir           gitdomain.RepoRootDir
	UnvalidatedConfig config.UnvalidatedConfig
	Verbose           bool
}

Jump to

Keyboard shortcuts

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