Skip to content

Commit

Permalink
Add comments to addFuncs (#3172)
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev authored Jul 18, 2024
1 parent 8996858 commit 0b436b4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,20 @@ var (

// addFunc adds a FileAnnotation.
//
// Both the Descriptor and Location can be nil.
type addFunc func(bufprotosource.Descriptor, []bufprotosource.Descriptor, bufprotosource.Location, string, ...interface{})
// descriptor is what the FileAnnotation applies to.
// extraIgnoreDescriptors are extra descriptors to check for ignores. This is used in situations
// where the file we care about has been deleted, and we want to use the previous file to check
// for things like config ignores or unstable packages.
// location is the granular Location of the FileAnnotation.
//
// descriptor, extraIgnoreDescriptors, and location can be nil.
type addFunc func(
descriptor bufprotosource.Descriptor,
extraIgnoreDescriptors []bufprotosource.Descriptor,
location bufprotosource.Location,
format string,
args ...interface{},
)

// corpus is a store of the previous files and files given to a check function.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ import (
// location != descriptor.Location().
//
// descriptor, location, and extraIgnoreLocations can be nil.
type addFunc func(descriptior bufprotosource.Descriptor, location bufprotosource.Location, extraIgnoreLocations []bufprotosource.Location, message string, args ...interface{})
type addFunc func(
descriptior bufprotosource.Descriptor,
location bufprotosource.Location,
extraIgnoreLocations []bufprotosource.Location,
format string,
args ...interface{},
)

func fieldToLowerSnakeCase(s string) string {
// Try running this on googleapis and watch
Expand Down

0 comments on commit 0b436b4

Please sign in to comment.