this repo has no description
0
fork

Configure Feed

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

cmd/cue/cmd: only allow dot files when specified explicitly

Issue #123

Change-Id: I0b8150fbe91362790562a8d7bcb8f6bc665c09bf
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3500
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>

+18 -1
+9
cmd/cue/cmd/testdata/script/eval_hiddenfail.txt
··· 1 + ! cue eval 2 + cmp stderr expect-stderr 3 + 4 + -- expect-stderr -- 5 + build constraints exclude all CUE files in . (ignored: .foo.cue) 6 + -- .foo.cue -- 7 + package foo 8 + 9 + a: 42
+1 -1
cmd/cue/cmd/testdata/script/hidden.txt cmd/cue/cmd/testdata/script/eval_hidden.txt
··· 1 - cue eval 1 + cue eval .foo.cue 2 2 cmp stdout expect-stdout 3 3 4 4 -- expect-stdout --
+4
cue/load/config.go
··· 115 115 // a package. 116 116 Tools bool 117 117 118 + // filesMode indicates that files are specified 119 + // explicitly on the command line. 120 + filesMode bool 121 + 118 122 // If DataFiles is set, the loader includes entries for directories that 119 123 // have no CUE files, but have recognized data files that could be converted 120 124 // to CUE.
+1
cue/load/loader.go
··· 98 98 func (l *loader) cueFilesPackage(files []string) *build.Instance { 99 99 pos := token.NoPos 100 100 cfg := l.cfg 101 + cfg.filesMode = true 101 102 // ModInit() // TODO: support modules 102 103 pkg := l.cfg.Context.NewInstance(cfg.Dir, l.loadFunc()) 103 104
+3
cue/load/match.go
··· 46 46 if strings.HasPrefix(name, "_") { 47 47 return 48 48 } 49 + if !cfg.filesMode && strings.HasPrefix(name, ".") { 50 + return 51 + } 49 52 50 53 i := strings.LastIndex(name, ".") 51 54 if i < 0 {