diff --git a/rules/aip0132/request_parent_valid_reference.go b/rules/aip0132/request_parent_valid_reference.go index 3465e2703..30d47f01a 100644 --- a/rules/aip0132/request_parent_valid_reference.go +++ b/rules/aip0132/request_parent_valid_reference.go @@ -19,6 +19,7 @@ import ( "strings" "github.com/googleapis/api-linter/lint" + "github.com/googleapis/api-linter/locations" "github.com/googleapis/api-linter/rules/internal/utils" "github.com/jhump/protoreflect/desc" ) @@ -49,6 +50,7 @@ var requestParentValidReference = &lint.FieldRule{ return []lint.Problem{{ Message: fmt.Sprintf("The `google.api.resource_reference` on `%s` field should reference the parent(s) of `%s`.", f.GetName(), res), Descriptor: f, + Location: locations.FieldResourceReference(f), }} } } diff --git a/rules/aip0140/lower_snake.go b/rules/aip0140/lower_snake.go index fc84ac1bd..64e730bbb 100644 --- a/rules/aip0140/lower_snake.go +++ b/rules/aip0140/lower_snake.go @@ -18,6 +18,7 @@ import ( "fmt" "github.com/googleapis/api-linter/lint" + "github.com/googleapis/api-linter/locations" "github.com/jhump/protoreflect/desc" ) @@ -30,6 +31,7 @@ var lowerSnake = &lint.FieldRule{ Message: fmt.Sprintf("Field `%s` must use lower_snake_case.", got), Suggestion: want, Descriptor: f, + Location: locations.DescriptorName(f), }} } return nil diff --git a/rules/aip0140/reserved_words.go b/rules/aip0140/reserved_words.go index bb526c0a4..7d419428b 100644 --- a/rules/aip0140/reserved_words.go +++ b/rules/aip0140/reserved_words.go @@ -19,6 +19,7 @@ import ( "bitbucket.org/creachadair/stringset" "github.com/googleapis/api-linter/lint" + "github.com/googleapis/api-linter/locations" "github.com/jhump/protoreflect/desc" ) @@ -29,6 +30,7 @@ var reservedWords = &lint.FieldRule{ return []lint.Problem{{ Message: fmt.Sprintf("%q is a reserved word in a common language and should not be used.", name), Descriptor: f, + Location: locations.DescriptorName(f), }} } return nil diff --git a/rules/aip0231/plural_method_name.go b/rules/aip0231/plural_method_name.go index 27844fd48..c10b446d5 100644 --- a/rules/aip0231/plural_method_name.go +++ b/rules/aip0231/plural_method_name.go @@ -19,6 +19,7 @@ import ( "github.com/gertd/go-pluralize" "github.com/googleapis/api-linter/lint" + "github.com/googleapis/api-linter/locations" "github.com/jhump/protoreflect/desc" ) @@ -40,6 +41,7 @@ var pluralMethodResourceName = &lint.MethodRule{ m.GetName(), pluralMethodResourceName, pluralize.Plural(pluralMethodResourceName), ), Descriptor: m, + Location: locations.DescriptorName(m), }} } diff --git a/rules/aip0231/request_names_field.go b/rules/aip0231/request_names_field.go index 1b23939a8..6cf2f6d38 100644 --- a/rules/aip0231/request_names_field.go +++ b/rules/aip0231/request_names_field.go @@ -87,6 +87,7 @@ var namesField = &lint.MessageRule{ problems = append(problems, lint.Problem{ Message: fmt.Sprintf(`The "requests" field on Batch Get Request should be a %q type`, rightTypeName), Descriptor: getReqMsg, + Location: locations.FieldType(getReqMsg), }) } return diff --git a/rules/aip0235/request_names_field.go b/rules/aip0235/request_names_field.go index e0ab29c0a..9690c255c 100644 --- a/rules/aip0235/request_names_field.go +++ b/rules/aip0235/request_names_field.go @@ -87,6 +87,7 @@ var requestNamesField = &lint.MessageRule{ problems = append(problems, lint.Problem{ Message: fmt.Sprintf(`The "requests" field on Batch Delete Request should be a %q type`, rightTypeName), Descriptor: deleteReqMsg, + Location: locations.FieldType(deleteReqMsg), }) } return