validator

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValid

func IsValid(result []*entity.ValidationResult) bool

IsValid checks if a pull request is valid or not from validation results

func NewBodyValidator

func NewBodyValidator(
	_ internal.GithubClient,
	config *entity.Configuration,
) internal.Validator

NewBodyValidator creates a new validator that validates if a pull request has a non-empty body

func NewBranchValidator

func NewBranchValidator(
	_ internal.GithubClient,
	config *entity.Configuration,
) internal.Validator

NewBranchValidator creates a validator that validates pull request branch name

func NewCommitValidator

func NewCommitValidator(
	client internal.GithubClient,
	config *entity.Configuration,
) internal.Validator

NewCommitValidator creates a new validator that will validate all commit messages in a pull request

func NewFileValidator

func NewFileValidator(
	_ internal.GithubClient,
	config *entity.Configuration,
) internal.Validator

NewFileValidator creates a new validator that validates if a pull request introduces too many file changes

func NewIssueValidator

func NewIssueValidator(
	client internal.GithubClient,
	config *entity.Configuration,
) internal.Validator

NewIssueValidator creates a new validator that validates issue resolution

func NewTitleValidator

func NewTitleValidator(
	_ internal.GithubClient,
	config *entity.Configuration,
) internal.Validator

NewTitleValidator creates a new validator that validates a pull request title

Types

type ValidatorGroup

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

ValidatorGroup is a collection of validation process, integrated in one function call

func NewValidatorGroup

func NewValidatorGroup(
	client internal.GithubClient,
	config *entity.Configuration,
	wg *sync.WaitGroup,
) *ValidatorGroup

NewValidatorGroup creates a new ValidatorGroup

func (*ValidatorGroup) Process

func (v *ValidatorGroup) Process(
	ctx context.Context,
	pullRequest *entity.PullRequest,
) []*entity.ValidationResult

Process the pull request with all available validators

Jump to

Keyboard shortcuts

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