Skip to content

Commit

Permalink
REPEATED_FIELD_NAMES_PLURALIZED accounts for 'info' as uncountable names
Browse files Browse the repository at this point in the history
  • Loading branch information
yoheimuta committed Jan 29, 2025
1 parent 6a089f1 commit 18d2bb3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _example/proto/issue_447/info.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
syntax = "proto3";

message Xyz {
repeated AdditionalInfo additional_info = 1;
}
1 change: 1 addition & 0 deletions linter/strs/pluralize.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func NewPluralizeClient() *PluralizeClient {
}
c.AddPluralRule("(?i)uri$", "uris")
c.AddSingularRule("(?i)uris$", "uri")
c.AddUncountableRule("(?i)info$")
return c
}

Expand Down
2 changes: 2 additions & 0 deletions linter/strs/pluralize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func TestPluralizeClient_ToPlural(t *testing.T) {
{"special case #312: appends s to module_uri", "module_uri", "module_uris"},
{"special case #312: not change uris", "uris", "uris"},
{"special case #312: not change module_uris", "module_uris", "module_uris"},
{"case #447: PluralizeUncountableWord", "info", "info"},
{"case #447: PluralizeUncountableWord2", "additional_info", "additional_info"},
}
for _, test := range tests {
test := test
Expand Down

0 comments on commit 18d2bb3

Please sign in to comment.