Select committed validation inputs by module
This commit is contained in:
14
check.go
14
check.go
@@ -55,7 +55,11 @@ type ReleaseRequest struct {
|
||||
// ValidationSpec selects optional shared validation checks. Its zero value
|
||||
// preserves the current validation behavior.
|
||||
type ValidationSpec struct {
|
||||
Go GoValidationSpec
|
||||
// SharedFiles adds repository-relative committed files to optional file
|
||||
// checks. Nil selects the optional defaults; an empty non-nil slice selects
|
||||
// none. Explicit files are checked for presence even when file checks are off.
|
||||
SharedFiles []string
|
||||
Go GoValidationSpec
|
||||
// GoFormat checks the formatting of committed regular Go source files. It
|
||||
// does not modify repository contents and is disabled when false.
|
||||
GoFormat bool
|
||||
@@ -176,6 +180,7 @@ func candidateRequest(request ReleaseRequest) candidate.Request {
|
||||
Race: request.Validation.Go.Race,
|
||||
FullVet: request.Validation.Go.FullVet,
|
||||
CompileTargets: make([]validation.Target, len(request.Validation.Go.CompileTargets)),
|
||||
SharedFiles: copyStringSlice(request.Validation.SharedFiles),
|
||||
GoFormat: request.Validation.GoFormat,
|
||||
Markdown: internalMarkdownSettings(request.Validation.Markdown),
|
||||
ModuleDistribution: validation.ModuleDistributionSettings{
|
||||
@@ -194,6 +199,13 @@ func candidateRequest(request ReleaseRequest) candidate.Request {
|
||||
return result
|
||||
}
|
||||
|
||||
func copyStringSlice(values []string) []string {
|
||||
if values == nil {
|
||||
return nil
|
||||
}
|
||||
return append(make([]string, 0, len(values)), values...)
|
||||
}
|
||||
|
||||
func internalMarkdownSettings(spec *MarkdownValidationSpec) *validation.MarkdownSettings {
|
||||
if spec == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user