this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cue/load: add initial module.cue schema

This adds the module.cue file format definition and verifies against it
when loading the configuration. We only add the existing single `module`
field for now.

I've added some tests that show the errors resulting from a bad module.cue
file look reasonable, which necessitated reshuffling the existing
test data around a bit.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I7339b96df9c195eeb02fda5197e790d15a6aad1d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549008
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+229 -134
+7 -55
cue/load/config.go
··· 22 22 "path/filepath" 23 23 "strings" 24 24 25 - "cuelang.org/go/cue" 26 25 "cuelang.org/go/cue/ast" 27 26 "cuelang.org/go/cue/build" 28 27 "cuelang.org/go/cue/errors" 29 - "cuelang.org/go/cue/parser" 30 28 "cuelang.org/go/cue/token" 31 29 "cuelang.org/go/internal" 32 - "cuelang.org/go/internal/core/runtime" 33 30 ) 34 31 35 32 const ( ··· 142 139 // Module specifies the module prefix. If not empty, this value must match 143 140 // the module field of an existing cue.mod file. 144 141 Module string 142 + 143 + // modFile holds the contents of the module file, or nil 144 + // if no module file was present. If non-nil, then 145 + // after calling Config.complete, modFile.Module will be 146 + // equal to Module. 147 + modFile *modFile 145 148 146 149 // Package defines the name of the package to be loaded. If this is not set, 147 150 // the package must be uniquely defined from its context. Special values: ··· 518 521 } else if !filepath.IsAbs(c.ModuleRoot) { 519 522 c.ModuleRoot = filepath.Join(c.Dir, c.ModuleRoot) 520 523 } 521 - if err := c.completeModule(); err != nil { 524 + if err := c.loadModule(); err != nil { 522 525 return nil, err 523 526 } 524 527 c.loader = &loader{ ··· 534 537 ) 535 538 } 536 539 return &c, nil 537 - } 538 - 539 - // completeModule fills out c.Module if it's empty or checks it for 540 - // consistency with the module file otherwise. 541 - func (c *Config) completeModule() error { 542 - // TODO: also make this work if run from outside the module? 543 - mod := filepath.Join(c.ModuleRoot, modDir) 544 - info, cerr := c.fileSystem.stat(mod) 545 - if cerr != nil { 546 - return nil 547 - } 548 - // TODO remove support for legacy non-directory module.cue file 549 - // by returning an error if info.IsDir is false. 550 - if info.IsDir() { 551 - mod = filepath.Join(mod, moduleFile) 552 - } 553 - f, cerr := c.fileSystem.openFile(mod) 554 - if cerr != nil { 555 - return nil 556 - } 557 - defer f.Close() 558 - 559 - // TODO: move to full build again 560 - file, err := parser.ParseFile("load", f) 561 - if err != nil { 562 - return errors.Wrapf(err, token.NoPos, "invalid cue.mod file") 563 - } 564 - // TODO disallow non-data-mode CUE. 565 - 566 - ctx := (*cue.Context)(runtime.New()) 567 - v := ctx.BuildFile(file) 568 - if err := v.Validate(); err != nil { 569 - return errors.Wrapf(err, token.NoPos, "invalid cue.mod file") 570 - } 571 - prefix := v.LookupPath(cue.MakePath(cue.Str("module"))) 572 - if prefix.Err() != nil { 573 - // TODO check better for not-found? 574 - return nil 575 - } 576 - name, err := prefix.String() 577 - if err != nil { 578 - return err 579 - } 580 - if c.Module == "" { 581 - c.Module = name 582 - return nil 583 - } 584 - if c.Module == name { 585 - return nil 586 - } 587 - return errors.Newf(prefix.Pos(), "inconsistent modules: got %q, want %q", name, c.Module) 588 540 } 589 541 590 542 func (c Config) isRoot(dir string) bool {
+14 -5
cue/load/import_test.go
··· 16 16 17 17 import ( 18 18 "os" 19 + "path/filepath" 19 20 "reflect" 20 21 "testing" 21 22 ··· 23 24 "cuelang.org/go/cue/token" 24 25 ) 25 26 26 - const testdata = "./testdata/" 27 + func testMod(dir string) string { 28 + cwd, err := os.Getwd() 29 + if err != nil { 30 + panic(err) 31 + } 32 + return filepath.Join(cwd, "testdata", dir) 33 + } 27 34 28 35 func getInst(pkg, cwd string) (*build.Instance, error) { 29 36 c, _ := (&Config{Dir: cwd}).complete() ··· 50 57 } 51 58 52 59 func TestEmptyFolderImport(t *testing.T) { 53 - _, err := getInst(".", testdata+"empty") 60 + path := filepath.Join(testMod("testmod"), "empty") 61 + _, err := getInst(".", path) 54 62 if _, ok := err.(*NoFilesError); !ok { 55 - t.Fatal(`Import("testdata/empty") did not return NoCUEError.`) 63 + t.Fatalf(`Import(%q) did not return NoCUEError.`, path) 56 64 } 57 65 } 58 66 59 67 func TestMultiplePackageImport(t *testing.T) { 60 - _, err := getInst(".", testdata+"multi") 68 + path := filepath.Join(testMod("testmod"), "multi") 69 + _, err := getInst(".", path) 61 70 mpe, ok := err.(*MultiplePackageError) 62 71 if !ok { 63 - t.Fatal(`Import("testdata/multi") did not return MultiplePackageError.`) 72 + t.Fatalf(`Import(%q) did not return MultiplePackageError.`, path) 64 73 } 65 74 mpe.Dir = "" 66 75 want := &MultiplePackageError{
+108 -70
cue/load/loader_test.go
··· 27 27 "github.com/kylelemons/godebug/diff" 28 28 29 29 "cuelang.org/go/cue" 30 + "cuelang.org/go/cue/errors" 30 31 "cuelang.org/go/cue/format" 31 32 "cuelang.org/go/internal/str" 32 33 ) ··· 37 38 if err != nil { 38 39 t.Fatal(err) 39 40 } 40 - testdataDir := filepath.Join(cwd, testdata) 41 + testdataDir := testMod("testmod") 41 42 dirCfg := &Config{ 42 43 Dir: testdataDir, 43 44 Tools: true, 45 + } 46 + badModCfg := &Config{ 47 + Dir: testMod("badmod"), 44 48 } 45 49 46 50 args := str.StringList ··· 49 53 args []string 50 54 want string 51 55 }{{ 56 + cfg: badModCfg, 57 + args: args("."), 58 + want: ` 59 + err: module: invalid module.cue file: 2 errors in empty disjunction: 60 + module: invalid module.cue file: conflicting values 123 and "" (mismatched types int and string): 61 + $cueroot/cue/load/moduleschema.cue:4:20 62 + $CWD/testdata/badmod/cue.mod/module.cue:2:9 63 + module: invalid module.cue file: conflicting values 123 and =~"^[^@]+$" (mismatched types int and string): 64 + $cueroot/cue/load/moduleschema.cue:4:10 65 + $cueroot/cue/load/moduleschema.cue:9:21 66 + $CWD/testdata/badmod/cue.mod/module.cue:2:9 67 + path: "" 68 + module: "" 69 + root: "" 70 + dir: "" 71 + display:"" 72 + `, 73 + }, { 52 74 // Even though the directory is called testdata, the last path in 53 75 // the module is test. So "package test" is correctly the default 54 76 // package of this directory. ··· 57 79 want: ` 58 80 path: mod.test/test 59 81 module: mod.test/test 60 - root: $CWD/testdata 61 - dir: $CWD/testdata 82 + root: $CWD/testdata/testmod 83 + dir: $CWD/testdata/testmod 62 84 display:. 63 85 files: 64 - $CWD/testdata/test.cue 86 + $CWD/testdata/testmod/test.cue 65 87 imports: 66 - mod.test/test/sub: $CWD/testdata/sub/sub.cue`, 88 + mod.test/test/sub: $CWD/testdata/testmod/sub/sub.cue`, 67 89 }, { 68 90 // Even though the directory is called testdata, the last path in 69 91 // the module is test. So "package test" is correctly the default ··· 73 95 want: ` 74 96 path: mod.test/test 75 97 module: mod.test/test 76 - root: $CWD/testdata 77 - dir: $CWD/testdata 98 + root: $CWD/testdata/testmod 99 + dir: $CWD/testdata/testmod 78 100 display:. 79 101 files: 80 - $CWD/testdata/test.cue 102 + $CWD/testdata/testmod/test.cue 81 103 imports: 82 - mod.test/test/sub: $CWD/testdata/sub/sub.cue`, 104 + mod.test/test/sub: $CWD/testdata/testmod/sub/sub.cue`, 83 105 }, { 84 106 // TODO: 85 107 // - path incorrect, should be mod.test/test/other:main. 86 108 cfg: dirCfg, 87 109 args: args("./other/..."), 88 110 want: ` 89 - err: import failed: relative import paths not allowed ("./file") 111 + err: import failed: relative import paths not allowed ("./file"): 112 + $CWD/testdata/testmod/other/main.cue:6:2 90 113 path: "" 91 114 module: mod.test/test 92 - root: $CWD/testdata 93 - dir: $CWD/testdata/cue.mod/gen 94 - display:`, 115 + root: $CWD/testdata/testmod 116 + dir: $CWD/testdata/testmod/cue.mod/gen 117 + display:""`, 95 118 }, { 96 119 cfg: dirCfg, 97 120 args: args("./anon"), ··· 100 123 anon/anon.cue: no package name 101 124 path: mod.test/test/anon 102 125 module: mod.test/test 103 - root: $CWD/testdata 104 - dir: $CWD/testdata/anon 126 + root: $CWD/testdata/testmod 127 + dir: $CWD/testdata/testmod/anon 105 128 display:./anon`, 106 129 }, { 107 130 // TODO: ··· 109 132 cfg: dirCfg, 110 133 args: args("./other"), 111 134 want: ` 112 - err: import failed: relative import paths not allowed ("./file") 135 + err: import failed: relative import paths not allowed ("./file"): 136 + $CWD/testdata/testmod/other/main.cue:6:2 113 137 path: mod.test/test/other:main 114 138 module: mod.test/test 115 - root: $CWD/testdata 116 - dir: $CWD/testdata/other 139 + root: $CWD/testdata/testmod 140 + dir: $CWD/testdata/testmod/other 117 141 display:./other 118 142 files: 119 - $CWD/testdata/other/main.cue`, 143 + $CWD/testdata/testmod/other/main.cue`, 120 144 }, { 121 145 // TODO: 122 146 // - incorrect path, should be mod.test/test/hello:test ··· 125 149 want: ` 126 150 path: mod.test/test/hello:test 127 151 module: mod.test/test 128 - root: $CWD/testdata 129 - dir: $CWD/testdata/hello 152 + root: $CWD/testdata/testmod 153 + dir: $CWD/testdata/testmod/hello 130 154 display:./hello 131 155 files: 132 - $CWD/testdata/test.cue 133 - $CWD/testdata/hello/test.cue 156 + $CWD/testdata/testmod/test.cue 157 + $CWD/testdata/testmod/hello/test.cue 134 158 imports: 135 - mod.test/test/sub: $CWD/testdata/sub/sub.cue`, 159 + mod.test/test/sub: $CWD/testdata/testmod/sub/sub.cue`, 136 160 }, { 137 161 // TODO: 138 162 // - incorrect path, should be mod.test/test/hello:test ··· 141 165 want: ` 142 166 path: mod.test/test/hello:test 143 167 module: mod.test/test 144 - root: $CWD/testdata 145 - dir: $CWD/testdata/hello 168 + root: $CWD/testdata/testmod 169 + dir: $CWD/testdata/testmod/hello 146 170 display:mod.test/test/hello:test 147 171 files: 148 - $CWD/testdata/test.cue 149 - $CWD/testdata/hello/test.cue 172 + $CWD/testdata/testmod/test.cue 173 + $CWD/testdata/testmod/hello/test.cue 150 174 imports: 151 - mod.test/test/sub: $CWD/testdata/sub/sub.cue`, 175 + mod.test/test/sub: $CWD/testdata/testmod/sub/sub.cue`, 152 176 }, { 153 177 // TODO: 154 178 // - incorrect path, should be mod.test/test/hello:test ··· 161 185 hello/test.cue: package is test, want nonexist 162 186 path: mod.test/test/hello:nonexist 163 187 module: mod.test/test 164 - root: $CWD/testdata 165 - dir: $CWD/testdata/hello 188 + root: $CWD/testdata/testmod 189 + dir: $CWD/testdata/testmod/hello 166 190 display:mod.test/test/hello:nonexist`, 167 191 }, { 168 192 cfg: dirCfg, ··· 170 194 want: ` 171 195 path: "" 172 196 module: "" 173 - root: $CWD/testdata 174 - dir: $CWD/testdata 197 + root: $CWD/testdata/testmod 198 + dir: $CWD/testdata/testmod 175 199 display:command-line-arguments 176 200 files: 177 - $CWD/testdata/anon.cue 178 - $CWD/testdata/other/anon.cue`, 201 + $CWD/testdata/testmod/anon.cue 202 + $CWD/testdata/testmod/other/anon.cue`, 179 203 }, { 180 204 cfg: dirCfg, 181 205 // Absolute file is normalized. 182 - args: args(filepath.Join(cwd, "testdata", "anon.cue")), 206 + args: args(filepath.Join(testMod("testmod"), "anon.cue")), 183 207 want: ` 184 208 path: "" 185 209 module: "" 186 - root: $CWD/testdata 187 - dir: $CWD/testdata 210 + root: $CWD/testdata/testmod 211 + dir: $CWD/testdata/testmod 188 212 display:command-line-arguments 189 213 files: 190 - $CWD/testdata/anon.cue`, 214 + $CWD/testdata/testmod/anon.cue`, 191 215 }, { 192 216 cfg: dirCfg, 193 217 args: args("-"), 194 218 want: ` 195 219 path: "" 196 220 module: "" 197 - root: $CWD/testdata 198 - dir: $CWD/testdata 221 + root: $CWD/testdata/testmod 222 + dir: $CWD/testdata/testmod 199 223 display:command-line-arguments 200 224 files: 201 225 -`, ··· 207 231 err: cannot find package "non-existing" 208 232 path: non-existing 209 233 module: mod.test/test 210 - root: $CWD/testdata 211 - dir: $CWD/testdata/cue.mod/gen/non-existing 234 + root: $CWD/testdata/testmod 235 + dir: $CWD/testdata/testmod/cue.mod/gen/non-existing 212 236 display:non-existing`, 213 237 }, { 214 238 cfg: dirCfg, ··· 217 241 err: no CUE files in ./empty 218 242 path: mod.test/test/empty 219 243 module: mod.test/test 220 - root: $CWD/testdata 221 - dir: $CWD/testdata/empty 244 + root: $CWD/testdata/testmod 245 + dir: $CWD/testdata/testmod/empty 222 246 display:./empty`, 223 247 }, { 224 248 cfg: dirCfg, ··· 226 250 want: ` 227 251 path: mod.test/test/imports 228 252 module: mod.test/test 229 - root: $CWD/testdata 230 - dir: $CWD/testdata/imports 253 + root: $CWD/testdata/testmod 254 + dir: $CWD/testdata/testmod/imports 231 255 display:./imports 232 256 files: 233 - $CWD/testdata/imports/imports.cue 257 + $CWD/testdata/testmod/imports/imports.cue 234 258 imports: 235 - mod.test/catch: $CWD/testdata/cue.mod/pkg/mod.test/catch/catch.cue 236 - mod.test/helper:helper1: $CWD/testdata/cue.mod/pkg/mod.test/helper/helper1.cue`, 259 + mod.test/catch: $CWD/testdata/testmod/cue.mod/pkg/mod.test/catch/catch.cue 260 + mod.test/helper:helper1: $CWD/testdata/testmod/cue.mod/pkg/mod.test/helper/helper1.cue`, 237 261 }, { 238 262 cfg: dirCfg, 239 263 args: args("./toolonly"), 240 264 want: ` 241 265 path: mod.test/test/toolonly:foo 242 266 module: mod.test/test 243 - root: $CWD/testdata 244 - dir: $CWD/testdata/toolonly 267 + root: $CWD/testdata/testmod 268 + dir: $CWD/testdata/testmod/toolonly 245 269 display:./toolonly 246 270 files: 247 - $CWD/testdata/toolonly/foo_tool.cue`, 271 + $CWD/testdata/testmod/toolonly/foo_tool.cue`, 248 272 }, { 249 273 cfg: &Config{ 250 274 Dir: testdataDir, ··· 257 281 toolonly/foo_tool.cue: _tool.cue files excluded in non-cmd mode 258 282 path: mod.test/test/toolonly:foo 259 283 module: mod.test/test 260 - root: $CWD/testdata 261 - dir: $CWD/testdata/toolonly 284 + root: $CWD/testdata/testmod 285 + dir: $CWD/testdata/testmod/toolonly 262 286 display:./toolonly`, 263 287 }, { 264 288 cfg: &Config{ ··· 269 293 want: ` 270 294 path: mod.test/test/tags 271 295 module: mod.test/test 272 - root: $CWD/testdata 273 - dir: $CWD/testdata/tags 296 + root: $CWD/testdata/testmod 297 + dir: $CWD/testdata/testmod/tags 274 298 display:./tags 275 299 files: 276 - $CWD/testdata/tags/prod.cue`, 300 + $CWD/testdata/testmod/tags/prod.cue`, 277 301 }, { 278 302 cfg: &Config{ 279 303 Dir: testdataDir, ··· 283 307 want: ` 284 308 path: mod.test/test/tags 285 309 module: mod.test/test 286 - root: $CWD/testdata 287 - dir: $CWD/testdata/tags 310 + root: $CWD/testdata/testmod 311 + dir: $CWD/testdata/testmod/tags 288 312 display:./tags 289 313 files: 290 - $CWD/testdata/tags/prod.cue`, 314 + $CWD/testdata/testmod/tags/prod.cue`, 291 315 }, { 292 316 cfg: &Config{ 293 317 Dir: testdataDir, ··· 295 319 }, 296 320 args: args("./tagsbad"), 297 321 want: ` 298 - err: multiple @if attributes (and 2 more errors) 322 + err: tag "prod" not used in any file 323 + previous declaration here: 324 + $CWD/testdata/testmod/tagsbad/prod.cue:1:1 325 + multiple @if attributes: 326 + $CWD/testdata/testmod/tagsbad/prod.cue:2:1 299 327 path: mod.test/test/tagsbad 300 328 module: mod.test/test 301 - root: $CWD/testdata 302 - dir: $CWD/testdata/tagsbad 329 + root: $CWD/testdata/testmod 330 + dir: $CWD/testdata/testmod/tagsbad 303 331 display:./tagsbad`, 304 332 }} 305 333 for i, tc := range testCases { ··· 314 342 315 343 got := strings.TrimSpace(buf.String()) 316 344 got = strings.Replace(got, cwd, "$CWD", -1) 345 + // Errors are printed with slashes, so replace 346 + // the slash-separated form of CWD too. 347 + got = strings.Replace(got, filepath.ToSlash(cwd), "$CWD", -1) 317 348 // Make test work with Windows. 318 349 got = strings.Replace(got, string(filepath.Separator), "/", -1) 319 350 ··· 327 358 } 328 359 } 329 360 330 - var pkgInfo = template.Must(template.New("pkg").Parse(` 361 + var pkgInfo = template.Must(template.New("pkg").Funcs(template.FuncMap{ 362 + "errordetails": func(err error) string { 363 + s := errors.Details(err, &errors.Config{ 364 + ToSlash: true, 365 + }) 366 + s = strings.TrimSuffix(s, "\n") 367 + return s 368 + }}).Parse(` 331 369 {{- range . -}} 332 - {{- if .Err}}err: {{.Err}}{{end}} 370 + {{- if .Err}}err: {{errordetails .Err}}{{end}} 333 371 path: {{if .ImportPath}}{{.ImportPath}}{{else}}""{{end}} 334 - module: {{if .Module}}{{.Module}}{{else}}""{{end}} 335 - root: {{.Root}} 336 - dir: {{.Dir}} 337 - display:{{.DisplayPath}} 372 + module: {{with .Module}}{{.}}{{else}}""{{end}} 373 + root: {{with .Root}}{{.}}{{else}}""{{end}} 374 + dir: {{with .Dir}}{{.}}{{else}}""{{end}} 375 + display:{{with .DisplayPath}}{{.}}{{else}}""{{end}} 338 376 {{if .Files -}} 339 377 files: 340 378 {{- range .Files}}
+83
cue/load/module.go
··· 1 + package load 2 + 3 + import ( 4 + _ "embed" 5 + "io" 6 + 7 + "path/filepath" 8 + 9 + "cuelang.org/go/cue" 10 + "cuelang.org/go/cue/errors" 11 + "cuelang.org/go/cue/parser" 12 + "cuelang.org/go/cue/token" 13 + "cuelang.org/go/internal/core/runtime" 14 + ) 15 + 16 + //go:embed moduleschema.cue 17 + var moduleSchema []byte 18 + 19 + type modFile struct { 20 + Module string `json:"module"` 21 + } 22 + 23 + // loadModule loads the module file, resolves and downloads module 24 + // dependencies. It sets c.Module if it's empty or checks it for 25 + // consistency with the module file otherwise. 26 + func (c *Config) loadModule() error { 27 + // TODO: also make this work if run from outside the module? 28 + mod := filepath.Join(c.ModuleRoot, modDir) 29 + info, cerr := c.fileSystem.stat(mod) 30 + if cerr != nil { 31 + return nil 32 + } 33 + // TODO remove support for legacy non-directory module.cue file 34 + // by returning an error if info.IsDir is false. 35 + if info.IsDir() { 36 + mod = filepath.Join(mod, moduleFile) 37 + } 38 + f, cerr := c.fileSystem.openFile(mod) 39 + if cerr != nil { 40 + return nil 41 + } 42 + defer f.Close() 43 + data, err := io.ReadAll(f) 44 + if err != nil { 45 + return err 46 + } 47 + 48 + // TODO: move to full build again 49 + file, err := parser.ParseFile(mod, data) 50 + if err != nil { 51 + return errors.Wrapf(err, token.NoPos, "invalid module.cue file") 52 + } 53 + // TODO disallow non-data-mode CUE. 54 + 55 + ctx := (*cue.Context)(runtime.New()) 56 + schemav := ctx.CompileBytes(moduleSchema, cue.Filename("$cueroot/cue/load/moduleschema.cue")) 57 + if err := schemav.Validate(); err != nil { 58 + return errors.Wrapf(err, token.NoPos, "internal error: invalid CUE module.cue schema") 59 + } 60 + v := ctx.BuildFile(file) 61 + if err := v.Validate(cue.Concrete(true)); err != nil { 62 + return errors.Wrapf(err, token.NoPos, "invalid module.cue file") 63 + } 64 + v = v.Unify(schemav) 65 + if err := v.Validate(); err != nil { 66 + return errors.Wrapf(err, token.NoPos, "invalid module.cue file") 67 + } 68 + var mf modFile 69 + if err := v.Decode(&mf); err != nil { 70 + return errors.Wrapf(err, token.NoPos, "internal error: cannot decode into modFile struct (\nfile %q\ncontents %q\nvalue %#v\n)", mod, data, v) 71 + } 72 + if mf.Module == "" { 73 + // Backward compatibility: allow empty module.cue file. 74 + // TODO maybe check that the rest of the fields are empty too? 75 + return nil 76 + } 77 + if c.Module != "" && c.Module != mf.Module { 78 + return errors.Newf(token.NoPos, "inconsistent modules: got %q, want %q", mf.Module, c.Module) 79 + } 80 + c.Module = mf.Module 81 + c.modFile = &mf 82 + return nil 83 + }
+11
cue/load/moduleschema.cue
··· 1 + // module indicates the module's import path. 2 + // For legacy reasons, we allow a missing module 3 + // directory and an empty module directive. 4 + module?: #Module | "" 5 + 6 + // #Module constraints a module path. 7 + // TODO encode the module path rules as regexp: 8 + // 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]))* 9 + #Module: =~"^[^@]+$" 10 + 11 + // TODO add the rest of the module schema definition.
cue/load/testdata/anon.cue cue/load/testdata/testmod/anon.cue
cue/load/testdata/anon/anon.cue cue/load/testdata/testmod/anon/anon.cue
cue/load/testdata/anon/dummy cue/load/testdata/testmod/anon/dummy
+2
cue/load/testdata/badmod/cue.mod/module.cue
··· 1 + 2 + module: 123
+4 -4
cue/load/testdata/cue.mod/module.cue cue/load/testdata/testmod/cue.mod/module.cue
··· 1 1 // Copyright 2018 The CUE Authors 2 - // 2 + // 3 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 4 // you may not use this file except in compliance with the License. 5 5 // You may obtain a copy of the License at 6 - // 6 + // 7 7 // http://www.apache.org/licenses/LICENSE-2.0 8 - // 8 + // 9 9 // Unless required by applicable law or agreed to in writing, software 10 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 12 // See the License for the specific language governing permissions and 13 13 // limitations under the License. 14 14 15 - module: "mod.test/test" 15 + module: "mod.test/test"
cue/load/testdata/cue.mod/pkg/mod.test/catch/catch.cue cue/load/testdata/testmod/cue.mod/pkg/mod.test/catch/catch.cue
cue/load/testdata/cue.mod/pkg/mod.test/helper/helper.cue cue/load/testdata/testmod/cue.mod/pkg/mod.test/helper/helper.cue
cue/load/testdata/cue.mod/pkg/mod.test/helper/helper1.cue cue/load/testdata/testmod/cue.mod/pkg/mod.test/helper/helper1.cue
cue/load/testdata/cue.mod/pkg/mod.test/helper/helper2.cue cue/load/testdata/testmod/cue.mod/pkg/mod.test/helper/helper2.cue
cue/load/testdata/empty/dummy cue/load/testdata/testmod/empty/dummy
cue/load/testdata/hello/test.cue cue/load/testdata/testmod/hello/test.cue
cue/load/testdata/imports/imports.cue cue/load/testdata/testmod/imports/imports.cue
cue/load/testdata/multi/file.cue cue/load/testdata/testmod/multi/file.cue
cue/load/testdata/multi/file_appengine.cue cue/load/testdata/testmod/multi/file_appengine.cue
cue/load/testdata/other/anon.cue cue/load/testdata/testmod/other/anon.cue
cue/load/testdata/other/file/file.cue cue/load/testdata/testmod/other/file/file.cue
cue/load/testdata/other/main.cue cue/load/testdata/testmod/other/main.cue
cue/load/testdata/sub/sub.cue cue/load/testdata/testmod/sub/sub.cue
cue/load/testdata/tags/prod.cue cue/load/testdata/testmod/tags/prod.cue
cue/load/testdata/tags/stage.cue cue/load/testdata/testmod/tags/stage.cue
cue/load/testdata/tagsbad/prod.cue cue/load/testdata/testmod/tagsbad/prod.cue
cue/load/testdata/tagsbad/stage.cue cue/load/testdata/testmod/tagsbad/stage.cue
cue/load/testdata/test.cue cue/load/testdata/testmod/test.cue
cue/load/testdata/toolonly/foo_tool.cue cue/load/testdata/testmod/toolonly/foo_tool.cue