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

Function PrintFileAnnotationSet

private/bufpkg/bufanalysis/bufanalysis.go:221–243  ·  view source on GitHub ↗

PrintFileAnnotationSet prints the file annotations separated by newlines.

(writer io.Writer, fileAnnotationSet FileAnnotationSet, formatString string)

Source from the content-addressed store, hash-verified

219
220// PrintFileAnnotationSet prints the file annotations separated by newlines.
221func PrintFileAnnotationSet(writer io.Writer, fileAnnotationSet FileAnnotationSet, formatString string) error {
222 format, err := ParseFormat(formatString)
223 if err != nil {
224 return err
225 }
226
227 switch format {
228 case FormatText:
229 return printAsText(writer, fileAnnotationSet.FileAnnotations())
230 case FormatJSON:
231 return printAsJSON(writer, fileAnnotationSet.FileAnnotations())
232 case FormatMSVS:
233 return printAsMSVS(writer, fileAnnotationSet.FileAnnotations())
234 case FormatJUnit:
235 return printAsJUnit(writer, fileAnnotationSet.FileAnnotations())
236 case FormatGithubActions:
237 return printAsGithubActions(writer, fileAnnotationSet.FileAnnotations())
238 case FormatGitLabCodeQuality:
239 return printAsGitLabCodeQuality(writer, fileAnnotationSet.FileAnnotations())
240 default:
241 return fmt.Errorf("unknown FileAnnotation Format: %v", format)
242 }
243}

Callers 8

runFunction · 0.92
runFunction · 0.92
runFunction · 0.92
handleFunction · 0.92
handleFunction · 0.92
TestBasicFunction · 0.92
getProtosourceFilesFunction · 0.92

Calls 8

printAsTextFunction · 0.85
printAsJSONFunction · 0.85
printAsMSVSFunction · 0.85
printAsJUnitFunction · 0.85
printAsGithubActionsFunction · 0.85
printAsGitLabCodeQualityFunction · 0.85
ParseFormatFunction · 0.70
FileAnnotationsMethod · 0.65

Tested by 1

TestBasicFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…