Skip to content

Commit

Permalink
fix: Permit full_resource_name as a field name. (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sneeringer committed Jul 17, 2020
1 parent dc24c16 commit 9b82a04
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/rules/0122/name-suffix.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ This rule enforces that fields do not use the suffix `_name`, as mandated in
This rule scans all fields complains if it sees the suffix `_name` on a field.

**Note:** The standard field `display_name` is exempt, as are `given_name` and
`family_name` (used to represent the human-readable name of a person).
`family_name` (used to represent the human-readable name of a person), and
`full_resource_name`.

## Examples

Expand Down
1 change: 1 addition & 0 deletions rules/aip0122/name_suffix.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var nameSuffix = &lint.FieldRule{
"display_name",
"family_name",
"given_name",
"full_resource_name",
"name",
).Contains(f.GetName())
},
Expand Down
1 change: 1 addition & 0 deletions rules/aip0122/name_suffix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func TestNameSuffix(t *testing.T) {
{"ValidStandardDisplay", "display_name", testutils.Problems{}},
{"ValidStandardGiven", "given_name", testutils.Problems{}},
{"ValidStandardFamily", "family_name", testutils.Problems{}},
{"ValidStandardFull", "full_resource_name", testutils.Problems{}},
{"Invalid", "author_name", testutils.Problems{{Suggestion: "author"}}},
} {
f := testutils.ParseProto3Tmpl(t, `
Expand Down

0 comments on commit 9b82a04

Please sign in to comment.