Skip to content

Commit

Permalink
add ENA to initialism list w/ preventions (#227)
Browse files Browse the repository at this point in the history
Issue #, if available:
aws-controllers-k8s/ec2-controller#17

Description of changes:
 - Add `ENA` to initialism list and prevent `"Enable" -> "ENAble" and "Enabling" -> "ENAbling" `


Grep to find other `Ena` words in aws models:

```
$ grep -r 'Ena[a-zA-Z]*' -o .  | sort | uniq | grep -v "Enabl"
./ec2/2016-11-15/api-2.json:EnaSupport
./ec2/2016-11-15/docs-2.json:EnaSupport
./ec2/2016-11-15/examples-1.json:EnaSupport
```

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
bwagner5 committed Oct 19, 2021
1 parent 7dd0760 commit a328190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/names/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ var (
{"Ecr", "ECR", "ecr", nil},
{"Efs", "EFS", "efs", nil},
{"Eks", "EKS", "eks", nil},
// Prevent "Enable" and "Enabling" from becoming "ENAble"
{"Ena", "ENA", "ena", regexp.MustCompile("Ena(?!bl)", regexp.None)},
{"Ecmp", "ECMP", "ecmp", nil},
{"Fpga", "FPGA", "fpga", nil},
{"Gpu", "GPU", "gpu", nil},
Expand Down
1 change: 1 addition & 0 deletions pkg/names/names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func TestNames(t *testing.T) {
{"IoPerformance", "IOPerformance", "ioPerformance", "io_performance"},
{"Vlan", "VLAN", "vlan", "vlan"},
{"Ecmp", "ECMP", "ecmp", "ecmp"},
{"Ena", "ENA", "ena", "ena"},
}
for _, tc := range testCases {
n := names.New(tc.original)
Expand Down

0 comments on commit a328190

Please sign in to comment.