Check committed Go formatting

This commit is contained in:
2026-10-07 22:39:15 +00:00
parent 368043984e
commit c5f925c949
17 changed files with 318 additions and 22 deletions

View File

@@ -49,6 +49,9 @@ type ReleaseRequest struct {
// preserves the current validation behavior.
type ValidationSpec struct {
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
}
// GoValidationSpec selects checks performed by the Go toolchain.
@@ -74,7 +77,9 @@ type GoValidationSpec struct {
// of test-time vet, and Validation.Go.CompileTargets compiles all packages for
// each selected GOOS/GOARCH pair after tests and vet with cgo disabled. Package
// compilation produces no artifacts and does not execute target binaries.
// Their zero values preserve the ordinary suite. If
// Validation.GoFormat checks regular committed Go source after those selected
// Go checks and before AdditionalChecks. Its zero value disables formatting.
// The zero values of all selections preserve the ordinary suite. If
// Build selects targets, Check builds them after validation in temporary
// storage outside the worktree, then rechecks
// branch, HEAD, worktree, index, and local tag state. Success establishes local
@@ -100,6 +105,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)),
GoFormat: request.Validation.GoFormat,
},
AdditionalChecks: candidateChecks(request.AdditionalChecks),
AfterValidate: internalbuild.CandidateCallback(internalBuildSpec(request.Build), request.Output),