MCPcopy Create free account
hub / github.com/bufbuild/buf / imageToPathToExternalPath

Function imageToPathToExternalPath

private/bufpkg/bufcheck/util.go:44–52  ·  view source on GitHub ↗

imageToPathToExternalPath returns a map from path to external path for all ImageFiles in the Image. We do not transmit external path information over the wire to plugins, so we need to keep track of this on the client side to properly construct bufanalysis.FileAnnotations when we get back check.Ann

(image bufimage.Image)

Source from the content-addressed store, hash-verified

42// of this on the client side to properly construct bufanalysis.FileAnnotations when we get back
43// check.Annotations. This is used in annotationToFileAnnotation.
44func imageToPathToExternalPath(image bufimage.Image) map[string]string {
45 imageFiles := image.Files()
46 pathToExternalPath := make(map[string]string, len(imageFiles))
47 for _, imageFile := range imageFiles {
48 // We know that Images do not have overlapping paths.
49 pathToExternalPath[imageFile.Path()] = imageFile.ExternalPath()
50 }
51 return pathToExternalPath
52}

Callers 2

LintMethod · 0.85
BreakingMethod · 0.85

Calls 3

FilesMethod · 0.65
PathMethod · 0.65
ExternalPathMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…