Skip to content

Commit a328190

Browse files
authored
add ENA to initialism list w/ preventions (#227)
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.
1 parent 7dd0760 commit a328190

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pkg/names/names.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ var (
9191
{"Ecr", "ECR", "ecr", nil},
9292
{"Efs", "EFS", "efs", nil},
9393
{"Eks", "EKS", "eks", nil},
94+
// Prevent "Enable" and "Enabling" from becoming "ENAble"
95+
{"Ena", "ENA", "ena", regexp.MustCompile("Ena(?!bl)", regexp.None)},
9496
{"Ecmp", "ECMP", "ecmp", nil},
9597
{"Fpga", "FPGA", "fpga", nil},
9698
{"Gpu", "GPU", "gpu", nil},

pkg/names/names_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func TestNames(t *testing.T) {
6565
{"IoPerformance", "IOPerformance", "ioPerformance", "io_performance"},
6666
{"Vlan", "VLAN", "vlan", "vlan"},
6767
{"Ecmp", "ECMP", "ecmp", "ecmp"},
68+
{"Ena", "ENA", "ena", "ena"},
6869
}
6970
for _, tc := range testCases {
7071
n := names.New(tc.original)

0 commit comments

Comments
 (0)