Skip to content

Commit

Permalink
Remove IsImport from bufmoduleref.FileInfo and move to bufimage.Image…
Browse files Browse the repository at this point in the history
…File (#2525)
  • Loading branch information
bufdev committed Oct 31, 2023
1 parent 6b2bc3d commit 10a67aa
Show file tree
Hide file tree
Showing 17 changed files with 156 additions and 211 deletions.
88 changes: 43 additions & 45 deletions private/buf/cmd/buf/command/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ func run(
}
moduleFileSets[i] = moduleFileSet
}
// There are two cases where we need an image to filter the output:

// We build the image to filter the output:
// 1) the input is a proto file reference
// 2) ensuring that we are including the relevant imports
//
Expand All @@ -204,42 +205,7 @@ func run(
// and use the fact that something is in an image to determine if it is actually used.
var images []bufimage.Image
_, isProtoFileRef := sourceOrModuleRef.(buffetch.ProtoFileRef)
// We gate on flags.ExcludeImports/buffetch.ProtoFileRef so that we don't waste time building if the
// result of the build is not relevant.
if !flags.ExcludeImports {
imageBuilder := bufimagebuild.NewBuilder(container.Logger(), moduleReader)
for _, moduleFileSet := range moduleFileSets {
targetFileInfos, err := moduleFileSet.TargetFileInfos(ctx)
if err != nil {
return err
}
if len(targetFileInfos) == 0 {
// This ModuleFileSet doesn't have any targets, so we shouldn't build
// an image for it.
continue
}
image, fileAnnotations, err := imageBuilder.Build(
ctx,
moduleFileSet,
bufimagebuild.WithExcludeSourceCodeInfo(),
)
if err != nil {
return err
}
if len(fileAnnotations) > 0 {
// stderr since we do output to stdout potentially
if err := bufanalysis.PrintFileAnnotations(
container.Stderr(),
fileAnnotations,
bufanalysis.FormatText.String(),
); err != nil {
return err
}
return bufcli.ErrFileAnnotation
}
images = append(images, image)
}
} else if isProtoFileRef {
if isProtoFileRef {
// If the reference is a ProtoFileRef, we need to resolve the image for the reference,
// since the image config reader distills down the reference to the file and its dependencies,
// and also handles the #include_package_files option.
Expand Down Expand Up @@ -277,6 +243,39 @@ func run(
for _, imageConfig := range imageConfigs {
images = append(images, imageConfig.Image())
}
} else {
imageBuilder := bufimagebuild.NewBuilder(container.Logger(), moduleReader)
for _, moduleFileSet := range moduleFileSets {
targetFileInfos, err := moduleFileSet.TargetFileInfos(ctx)
if err != nil {
return err
}
if len(targetFileInfos) == 0 {
// This ModuleFileSet doesn't have any targets, so we shouldn't build
// an image for it.
continue
}
image, fileAnnotations, err := imageBuilder.Build(
ctx,
moduleFileSet,
bufimagebuild.WithExcludeSourceCodeInfo(),
)
if err != nil {
return err
}
if len(fileAnnotations) > 0 {
// stderr since we do output to stdout potentially
if err := bufanalysis.PrintFileAnnotations(
container.Stderr(),
fileAnnotations,
bufanalysis.FormatText.String(),
); err != nil {
return err
}
return bufcli.ErrFileAnnotation
}
images = append(images, image)
}
}
// images will only be non-empty if !flags.ExcludeImports || isProtoFileRef
// mergedImage will be nil if images is empty
Expand Down Expand Up @@ -350,14 +349,13 @@ func run(
}
// If the file is not an import in some ModuleFileSet, it will
// eventually be written via the iteration over moduleFileSets.
if fileInfo.IsImport() {
if flags.ExcludeImports {
// Exclude imports, don't output here
continue
} else if mergedImage == nil || mergedImage.GetFile(path) == nil {
// We check the merged image to see if the path exists. If it does,
// we use this import, so we want to output the file. If it doesn't,
// continue.
imageFile := mergedImage.GetFile(path)
// We check the merged image to see if the path exists.
if imageFile == nil {
continue
}
if flags.ExcludeImports {
if imageFile.IsImport() {
continue
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func newFileAnnotation(
fileInfo, err = bufmoduleref.NewFileInfo(
path,
"",
false,
nil,
"",
)
Expand Down Expand Up @@ -145,7 +144,6 @@ func normalizeFileAnnotations(
fileInfo, err = bufmoduleref.NewFileInfo(
fileInfo.Path(),
"",
false,
nil,
"",
)
Expand Down
3 changes: 3 additions & 0 deletions private/bufpkg/bufimage/bufimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
// ImageFile is a Protobuf file within an image.
type ImageFile interface {
bufmoduleref.FileInfo

// Proto is the backing *descriptorpb.FileDescriptorProto for this File.
//
// FileDescriptor should be preferred to Proto. We keep this method around
Expand All @@ -43,6 +44,8 @@ type ImageFile interface {
// This will never be nil.
// The value Path() is equal to FileDescriptor.GetName() .
FileDescriptor() protodescriptor.FileDescriptor
// IsImport returns true if this file is an import.
IsImport() bool
// IsSyntaxUnspecified will be true if the syntax was not explicitly specified.
IsSyntaxUnspecified() bool
// UnusedDependencyIndexes returns the indexes of the unused dependencies within
Expand Down
10 changes: 8 additions & 2 deletions private/bufpkg/bufimage/image_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type imageFile struct {

fileDescriptorProto *descriptorpb.FileDescriptorProto

isImport bool
isSyntaxUnspecified bool
storedUnusedDependencyIndexes []int32
}
Expand All @@ -46,7 +47,6 @@ func newImageFile(
fileInfo, err := bufmoduleref.NewFileInfo(
fileDescriptor.GetName(),
externalPath,
isImport,
moduleIdentity,
commit,
)
Expand All @@ -62,6 +62,7 @@ func newImageFile(
// protodescriptor.FileDescriptorProtoForFileDescriptor is a no-op if fileDescriptor
// is already a *descriptorpb.FileDescriptorProto
fileDescriptorProto: protodescriptor.FileDescriptorProtoForFileDescriptor(fileDescriptor),
isImport: isImport,
isSyntaxUnspecified: isSyntaxUnspecified,
storedUnusedDependencyIndexes: unusedDependencyIndexes,
}, nil
Expand All @@ -75,6 +76,10 @@ func (f *imageFile) FileDescriptor() protodescriptor.FileDescriptor {
return f.fileDescriptorProto
}

func (f *imageFile) IsImport() bool {
return f.isImport
}

func (f *imageFile) IsSyntaxUnspecified() bool {
return f.isSyntaxUnspecified
}
Expand All @@ -88,8 +93,9 @@ func (f *imageFile) ImageFileWithIsImport(isImport bool) ImageFile {
return f
}
return &imageFile{
FileInfo: f.FileInfo.FileInfoWithIsImport(isImport),
FileInfo: f.FileInfo,
fileDescriptorProto: f.fileDescriptorProto,
isImport: isImport,
isSyntaxUnspecified: f.isSyntaxUnspecified,
storedUnusedDependencyIndexes: f.storedUnusedDependencyIndexes,
}
Expand Down
128 changes: 64 additions & 64 deletions private/bufpkg/bufmodule/bufmodulebuild/module_bucket_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ func TestBucketGetFileInfos1(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "proto/a/1.proto", "testdata/1/proto/a/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/1/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/3.proto", "testdata/1/proto/a/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/c/1.proto", "testdata/1/proto/a/c/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/c/2.proto", "testdata/1/proto/a/c/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/c/3.proto", "testdata/1/proto/a/c/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/1.proto", "testdata/1/proto/d/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/2.proto", "testdata/1/proto/d/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/3.proto", "testdata/1/proto/d/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/1.proto", "testdata/1/proto/a/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/1/proto/a/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/3.proto", "testdata/1/proto/a/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/c/1.proto", "testdata/1/proto/a/c/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/c/2.proto", "testdata/1/proto/a/c/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/c/3.proto", "testdata/1/proto/a/c/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/1.proto", "testdata/1/proto/d/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/2.proto", "testdata/1/proto/d/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/3.proto", "testdata/1/proto/d/3.proto", nil, ""),
)
}

Expand All @@ -71,12 +71,12 @@ func TestBucketGetFileInfos2(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "proto/b/1.proto", "testdata/1/proto/b/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/2.proto", "testdata/1/proto/b/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/3.proto", "testdata/1/proto/b/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/1.proto", "testdata/1/proto/d/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/2.proto", "testdata/1/proto/d/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/3.proto", "testdata/1/proto/d/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/1.proto", "testdata/1/proto/b/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/2.proto", "testdata/1/proto/b/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/3.proto", "testdata/1/proto/b/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/1.proto", "testdata/1/proto/d/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/2.proto", "testdata/1/proto/d/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/3.proto", "testdata/1/proto/d/3.proto", nil, ""),
)
}

Expand All @@ -92,15 +92,15 @@ func TestBucketGetFileInfo3(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "proto/a/1.proto", "testdata/1/proto/a/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/1/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/3.proto", "testdata/1/proto/a/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/1.proto", "testdata/1/proto/b/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/2.proto", "testdata/1/proto/b/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/3.proto", "testdata/1/proto/b/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/1.proto", "testdata/1/proto/d/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/2.proto", "testdata/1/proto/d/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/3.proto", "testdata/1/proto/d/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/1.proto", "testdata/1/proto/a/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/1/proto/a/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/3.proto", "testdata/1/proto/a/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/1.proto", "testdata/1/proto/b/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/2.proto", "testdata/1/proto/b/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/3.proto", "testdata/1/proto/b/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/1.proto", "testdata/1/proto/d/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/2.proto", "testdata/1/proto/d/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/d/3.proto", "testdata/1/proto/d/3.proto", nil, ""),
)
}

Expand All @@ -119,12 +119,12 @@ func TestBucketGetFileInfos4(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "proto/a/1.proto", "testdata/1/proto/a/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/1/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/3.proto", "testdata/1/proto/a/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/1.proto", "testdata/1/proto/b/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/2.proto", "testdata/1/proto/b/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/3.proto", "testdata/1/proto/b/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/1.proto", "testdata/1/proto/a/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/1/proto/a/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/3.proto", "testdata/1/proto/a/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/1.proto", "testdata/1/proto/b/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/2.proto", "testdata/1/proto/b/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/b/3.proto", "testdata/1/proto/b/3.proto", nil, ""),
)
}

Expand Down Expand Up @@ -158,15 +158,15 @@ func TestConfigV1Beta1BucketGetFileInfos1(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "a/1.proto", "testdata/1/proto/a/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/2.proto", "testdata/1/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/3.proto", "testdata/1/proto/a/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/c/1.proto", "testdata/1/proto/a/c/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/c/2.proto", "testdata/1/proto/a/c/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/c/3.proto", "testdata/1/proto/a/c/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/1.proto", "testdata/1/proto/d/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/2.proto", "testdata/1/proto/d/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/3.proto", "testdata/1/proto/d/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/1.proto", "testdata/1/proto/a/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/2.proto", "testdata/1/proto/a/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/3.proto", "testdata/1/proto/a/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/c/1.proto", "testdata/1/proto/a/c/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/c/2.proto", "testdata/1/proto/a/c/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/c/3.proto", "testdata/1/proto/a/c/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/1.proto", "testdata/1/proto/d/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/2.proto", "testdata/1/proto/d/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/3.proto", "testdata/1/proto/d/3.proto", nil, ""),
)
}

Expand All @@ -187,12 +187,12 @@ func TestConfigV1Beta1BucketGetFileInfos2(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "b/1.proto", "testdata/1/proto/b/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/2.proto", "testdata/1/proto/b/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/3.proto", "testdata/1/proto/b/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/1.proto", "testdata/1/proto/d/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/2.proto", "testdata/1/proto/d/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/3.proto", "testdata/1/proto/d/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/1.proto", "testdata/1/proto/b/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/2.proto", "testdata/1/proto/b/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/3.proto", "testdata/1/proto/b/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/1.proto", "testdata/1/proto/d/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/2.proto", "testdata/1/proto/d/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/3.proto", "testdata/1/proto/d/3.proto", nil, ""),
)
}

Expand All @@ -213,15 +213,15 @@ func TestConfigV1Beta1BucketGetFileInfo3(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "a/1.proto", "testdata/1/proto/a/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/2.proto", "testdata/1/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/3.proto", "testdata/1/proto/a/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/1.proto", "testdata/1/proto/b/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/2.proto", "testdata/1/proto/b/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/3.proto", "testdata/1/proto/b/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/1.proto", "testdata/1/proto/d/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/2.proto", "testdata/1/proto/d/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "d/3.proto", "testdata/1/proto/d/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/1.proto", "testdata/1/proto/a/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/2.proto", "testdata/1/proto/a/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/3.proto", "testdata/1/proto/a/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/1.proto", "testdata/1/proto/b/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/2.proto", "testdata/1/proto/b/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/3.proto", "testdata/1/proto/b/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/1.proto", "testdata/1/proto/d/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/2.proto", "testdata/1/proto/d/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "d/3.proto", "testdata/1/proto/d/3.proto", nil, ""),
)
}

Expand All @@ -243,12 +243,12 @@ func TestConfigV1Beta1BucketGetFileInfos4(t *testing.T) {
t,
"testdata/1",
config,
bufmoduletesting.NewFileInfo(t, "a/1.proto", "testdata/1/proto/a/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/2.proto", "testdata/1/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/3.proto", "testdata/1/proto/a/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/1.proto", "testdata/1/proto/b/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/2.proto", "testdata/1/proto/b/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "b/3.proto", "testdata/1/proto/b/3.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "a/1.proto", "testdata/1/proto/a/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/2.proto", "testdata/1/proto/a/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "a/3.proto", "testdata/1/proto/a/3.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/1.proto", "testdata/1/proto/b/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/2.proto", "testdata/1/proto/b/2.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "b/3.proto", "testdata/1/proto/b/3.proto", nil, ""),
)
}

Expand Down Expand Up @@ -319,8 +319,8 @@ func TestDocumentation(t *testing.T) {
t,
"testdata/4",
bufmodule.DefaultDocumentationPath,
bufmoduletesting.NewFileInfo(t, "proto/1.proto", "testdata/4/proto/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/4/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/1.proto", "testdata/4/proto/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/4/proto/a/2.proto", nil, ""),
)
}

Expand All @@ -330,8 +330,8 @@ func TestLicense(t *testing.T) {
t,
"testdata/5",
"Test Module License",
bufmoduletesting.NewFileInfo(t, "proto/1.proto", "testdata/5/proto/1.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/5/proto/a/2.proto", false, nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/1.proto", "testdata/5/proto/1.proto", nil, ""),
bufmoduletesting.NewFileInfo(t, "proto/a/2.proto", "testdata/5/proto/a/2.proto", nil, ""),
)
}

Expand Down
Loading

0 comments on commit 10a67aa

Please sign in to comment.