Skip to content

Commit

Permalink
all: cue fmt
Browse files Browse the repository at this point in the history
This allows me to use `cue fmt --check ./...` as a benchmark via:

    https://pkg.go.dev/github.com/aclements/go-misc/benchcmd

Otherwise the command fails as some of our files are not well formatted.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ib31112d3973dad664fb707df103be57b7b55d4b0
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193393
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
  • Loading branch information
mvdan committed Apr 22, 2024
1 parent 6f8cbb0 commit 058ab7c
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmd/cue/cmd/testdata/script/help_registryconfig.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,5 @@ definition:

// TODO more specific schemas below
#modulePath: string
#tag: string
#tag: string

2 changes: 1 addition & 1 deletion cue/load/moduleschema.cue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ deps?: [#Module]: {
// #Module constraints a module path.
// TODO encode the module path rules as regexp:
// WIP: (([\-_~a-zA-Z0-9][.\-_~a-zA-Z0-9]*[\-_~a-zA-Z0-9])|([\-_~a-zA-Z0-9]))(/([\-_~a-zA-Z0-9][.\-_~a-zA-Z0-9]*[\-_~a-zA-Z0-9])|([\-_~a-zA-Z0-9]))*
#Module: =~"^[^@]+$"
#Module: =~"^[^@]+$"

// TODO add the rest of the module schema definition.
2 changes: 1 addition & 1 deletion cue/load/test.cue
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package test

"Hello world!"
"Hello world!"
8 changes: 4 additions & 4 deletions internal/ci/base/base.cue
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ gerritHubRepositoryURL: *("https://\(gerritHubHostname)/a/" + githubRepositoryPa
trybotRepositoryPath: *(githubRepositoryPath + "-" + trybot.key) | string
trybotRepositoryURL: *("https://github.com/" + trybotRepositoryPath) | string

defaultBranch: *"master" | string
testDefaultBranch: *"ci/test" | _
defaultBranch: *"master" | string
testDefaultBranch: *"ci/test" | _
protectedBranchPatterns: *[defaultBranch] | [...string]
releaseTagPrefix: *"v" | string
releaseTagPattern: *(releaseTagPrefix + "*") | string
releaseTagPrefix: *"v" | string
releaseTagPattern: *(releaseTagPrefix + "*") | string

botGitHubUser: string
botGitHubUserTokenSecretsKey: *(strings.ToUpper(botGitHubUser) + "_GITHUB_PAT") | string
Expand Down
2 changes: 1 addition & 1 deletion internal/ci/base/gerrithub.cue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ trybotDispatchWorkflow: bashWorkflow & {
(trybot.key): {
"runs-on": linuxMachine

let goodDummyData = [ if encjson.Marshal(#dummyDispatch) != _|_ {true}, false][0]
let goodDummyData = [if encjson.Marshal(#dummyDispatch) != _|_ {true}, false][0]

// We set the "on" conditions above, but this would otherwise mean we
// run for all dispatch events.
Expand Down
2 changes: 1 addition & 1 deletion internal/ci/ci_tool.cue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ command: gen: {
}

command: gen: codereviewcfg: file.Create & {
_dir: path.FromSlash("../../", path.Unix)
_dir: path.FromSlash("../../", path.Unix)
filename: path.Join([_dir, "codereview.cfg"], _goos)
let res = repo.toCodeReviewCfg & {#input: repo.codeReview, _}
let donotedit = repo.doNotEditMessage & {#generatedBy: "internal/ci/ci_tool.cue", _}
Expand Down
2 changes: 1 addition & 1 deletion internal/ci/goreleaser/goreleaser.cue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config: {
}]

builds: [
{main: "./cmd/cue", binary: "cue"},
{main: "./cmd/cue", binary: "cue"},
{main: "./cmd/cuepls", binary: "cuepls"},
]

Expand Down
2 changes: 1 addition & 1 deletion internal/mod/modresolve/schema.cue
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@

// TODO more specific schemas below
#modulePath: string
#tag: string
#tag: string
5 changes: 3 additions & 2 deletions mod/modfile/schema.cue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// Note: we're using 1&2 rather than _|_ because
// use of _|_ causes the source location of the errors
// to be lost. See https://github.com/cue-lang/cue/issues/2319.
let unimplemented = 1&2
let unimplemented = 1 & 2

// versions holds an element for each supported version
// of the schema. The version key specifies that
Expand All @@ -38,6 +38,7 @@ versions: [string]: {
// language.version field.
language!: version!: string
}

// #Strict can be unified with the top level schema to enforce the strict version
// of the schema required when publishing a module.
#Strict!: _
Expand Down Expand Up @@ -129,4 +130,4 @@ versions: "v0.9.0-alpha.0": {
// TODO support for other VCSs:
// kind!: "self" | "git" | "bzr" | "hg" | "svn"
}
}
}
10 changes: 5 additions & 5 deletions pkg/tool/http/http.cue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

package http

Get: Do & {method: "GET"}
Post: Do & {method: "POST"}
Put: Do & {method: "PUT"}
Get: Do & {method: "GET"}
Post: Do & {method: "POST"}
Put: Do & {method: "PUT"}
Delete: Do & {method: "DELETE"}

Do: {
Expand All @@ -35,15 +35,15 @@ Do: {

request: {
body?: bytes | string
header: [string]: string | [...string]
header: [string]: string | [...string]
trailer: [string]: string | [...string]
}
response: {
status: string
statusCode: int

body: *bytes | string
header: [string]: string | [...string]
header: [string]: string | [...string]
trailer: [string]: string | [...string]
}
}
Expand Down
10 changes: 5 additions & 5 deletions pkg/tool/http/pkg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 058ab7c

Please sign in to comment.