cuelang.org/go@v0.10.1/internal/ci/base/codereview.cue (about)

     1  package base
     2  
     3  // This file contains aspects principally related to git-codereview
     4  // configuration.
     5  
     6  import (
     7  	"strings"
     8  )
     9  
    10  // #codeReview defines the schema of a codereview.cfg file that
    11  // sits at the root of a repository. codereview.cfg is the configuration
    12  // file that drives golang.org/x/review/git-codereview. This config
    13  // file is also used by github.com/cue-sh/tools/cmd/cueckoo.
    14  #codeReview: {
    15  	gerrit?:      string
    16  	github?:      string
    17  	"cue-unity"?: string
    18  }
    19  
    20  // #toCodeReviewCfg converts a #codeReview instance to
    21  // the key: value
    22  toCodeReviewCfg: {
    23  	#input: #codeReview
    24  	let parts = [for k, v in #input {k + ": " + v}]
    25  
    26  	// Per https://pkg.go.dev/golang.org/x/review/git-codereview#hdr-Configuration
    27  	strings.Join(parts, "\n")
    28  }