prow/plugins/config.go
func (r RequireMatchingLabel) validate() error {
	if r.Org == "" {
		return errors.New("must specify 'org'")
	}
	if strings.Contains(r.Repo, "/") {
		return errors.New("'repo' may not contain '/'; specify the organization with 'org'")
	}
	if r.Regexp == "" {
		return errors.New("must specify 'regexp'")
	}
	if r.MissingLabel == "" {
		return errors.New("must specify 'missing_label'")
	}
	if r.GracePeriod == "" {
		return errors.New("must specify 'grace_period'")
	}
	if !r.PRs && !r.Issues {
		return errors.New("must specify 'prs: true' and/or 'issues: true'")
	}
	if !r.PRs && r.Branch != "" {
		return errors.New("branch cannot be specified without `prs: true'")
	}
	if r.Re.MatchString(r.MissingLabel) {
		return errors.New("'regexp' must not match 'missing_label'")
	}
	return nil
}
func (r RequireMatchingLabel) validate() error {
	if r.Org == "" {
		return errors.New("must specify 'org'")
	}
	if strings.Contains(r.Repo, "/") {
		return errors.New("'repo' may not contain '/'; specify the organization with 'org'")
	}
	if r.Regexp == "" {
		return errors.New("must specify 'regexp'")
	}
	if r.MissingLabel == "" {
		return errors.New("must specify 'missing_label'")
	}
	if r.GracePeriod == "" {
		return errors.New("must specify 'grace_period'")
	}
	if !r.PRs && !r.Issues {
		return errors.New("must specify 'prs: true' and/or 'issues: true'")
	}
	if !r.PRs && r.Branch != "" {
		return errors.New("branch cannot be specified without `prs: true'")
	}
	if r.Re.MatchString(r.MissingLabel) {
		return errors.New("'regexp' must not match 'missing_label'")
	}
	return nil
}
func ( r RequireMatchingLabel ) validate ( ) error { if r . Org == " " { return errors . New ( " " ) } if strings . Contains ( r . Repo , " " ) { return errors . New ( " " ) } if r . Regexp == " " { return errors . New ( " " ) } if r . MissingLabel == " " { return errors . New ( " " ) } if r . GracePeriod == " " { return errors . New ( " " ) } if ! r . PRs && ! r . Issues { return errors . New ( " " ) } if ! r . PRs && r . Branch != " " { return errors . New ( " " ) } if r . Re . MatchString ( r . MissingLabel ) { return errors . New ( " " ) } return nil }
// validate checks the following properties:
// - Org, Regexp, MissingLabel, and GracePeriod must be non-empty.
// - Repo does not contain a '/' (should use Org+Repo).
// - At least one of PRs or Issues must be true.
// - Branch only specified if 'prs: true'
// - MissingLabel must not match Regexp.
validate checks the following properties : - Org Regexp MissingLabel and GracePeriod must be non - empty . - Repo does not contain a / ( should use Org + Repo ) . - At least one of PRs or Issues must be true . - Branch only specified if prs : true - MissingLabel must not match Regexp .