Skip to content

Commit c2fb48f

Browse files
Add initialisms contained within ACM PCA (#322)
Description of changes: Add initialisms found within the ACM PCA types `CNAME`, `CRL`, `CPS`, `CSR`, `EDI`, `OCSP`, `RFC` By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 92aec8d commit c2fb48f

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

pkg/names/names.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,19 @@ var (
8282
{"Bgp", "BGP", "bgp", nil},
8383
{"Cors", "CORS", "cors", nil},
8484
{"Cidr", "CIDR", "cidr", nil},
85+
{"Cname", "CNAME", "cname", nil},
8586
{"Cpu", "CPU", "cpu", nil},
87+
{"Crl", "CRL", "crl", nil},
88+
{"Cps", "CPS", "cps", nil},
89+
{"Csr", "CSR", "csr", nil},
8690
{"Dhcp", "DHCP", "dhcp", nil},
8791
{"Dns", "DNS", "dns", nil},
8892
{"Dpd", "DPD", "dpd", nil},
8993
{"Ebs", "EBS", "ebs", nil},
9094
{"Ec2", "EC2", "ec2", nil},
9195
{"Ecr", "ECR", "ecr", nil},
96+
// Prevent "Edit" from becoming "EDIt"
97+
{"Edi", "EDI", "edi", regexp.MustCompile("Edi(?!t)", regexp.None)},
9298
{"Efs", "EFS", "efs", nil},
9399
{"Eks", "EKS", "eks", nil},
94100
// Prevent "Enable" and "Enabling" from becoming "ENAble"
@@ -112,6 +118,8 @@ var (
112118
// Prevent "Native" from becoming "NATive"
113119
{"Nat", "NAT", "nat", regexp.MustCompile("Nat(?!i)", regexp.None)},
114120
{"Oidc", "OIDC", "oidc", nil},
121+
{"Ocsp", "OCSP", "ocsp", nil},
122+
{"Rfc", "RFC", "rfc", nil},
115123
{"Sdk", "SDK", "sdk", nil},
116124
{"Sha256", "SHA256", "sha256", nil},
117125
{"Sqs", "SQS", "sns", nil},

pkg/names/names_test.go

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,44 +32,46 @@ func TestNames(t *testing.T) {
3232
expectSnake string
3333
}{
3434
{"Ami", "AMI", "ami", "ami"},
35-
{"Identifier", "Identifier", "identifier", "identifier"},
36-
{"Id", "ID", "id", "id"},
37-
{"ID", "ID", "id", "id"},
38-
{"Family", "Family", "family", "family"},
39-
{"Examine", "Examine", "examine", "examine"},
40-
{"Dynamic", "Dynamic", "dynamic", "dynamic"},
41-
{"Camila", "Camila", "camila", "camila"},
35+
{"AmiLaunchIndex", "AMILaunchIndex", "amiLaunchIndex", "ami_launch_index"},
4236
{"Amis", "AMIs", "amis", "amis"},
4337
{"AmiType", "AMIType", "amiType", "ami_type"},
44-
{"AmiLaunchIndex", "AMILaunchIndex", "amiLaunchIndex", "ami_launch_index"},
45-
{"NumberOfAmiToKeep", "NumberOfAMIToKeep", "numberOfAMIToKeep", "number_of_ami_to_keep"},
46-
{"RequestedAmiVersion", "RequestedAMIVersion", "requestedAMIVersion", "requested_ami_version"},
47-
{"KeyIdentifier", "KeyIdentifier", "keyIdentifier", "key_identifier"},
48-
{"KeyId", "KeyID", "keyID", "key_id"},
49-
{"KeyID", "KeyID", "keyID", "key_id"},
50-
{"SSEKMSKeyID", "SSEKMSKeyID", "sseKMSKeyID", "sse_kms_key_id"},
51-
{"DbiResourceId", "DBIResourceID", "dbiResourceID", "dbi_resource_id"},
38+
{"CacheSecurityGroup", "CacheSecurityGroup", "cacheSecurityGroup", "cache_security_group"},
39+
{"Camila", "Camila", "camila", "camila"},
5240
{"DbInstanceId", "DBInstanceID", "dbInstanceID", "db_instance_id"},
5341
{"DBInstanceId", "DBInstanceID", "dbInstanceID", "db_instance_id"},
5442
{"DBInstanceID", "DBInstanceID", "dbInstanceID", "db_instance_id"},
5543
{"DBInstanceIdentifier", "DBInstanceIdentifier", "dbInstanceIdentifier", "db_instance_identifier"},
56-
{"MaxIdleConnectionsPercent", "MaxIdleConnectionsPercent", "maxIdleConnectionsPercent", "max_idle_connections_percent"},
57-
{"CacheSecurityGroup", "CacheSecurityGroup", "cacheSecurityGroup", "cache_security_group"},
58-
{"RepositoryUriTest", "RepositoryURITest", "repositoryURITest", "repository_uri_test"},
59-
{"Ip", "IP", "ip", "ip"},
60-
{"MultipartUpload", "MultipartUpload", "multipartUpload", "multipart_upload"},
61-
{"Package", "Package", "package_", "package_"},
62-
{"LdapServerMetadata", "LDAPServerMetadata", "ldapServerMetadata", "ldap_server_metadata"},
44+
{"DbiResourceId", "DBIResourceID", "dbiResourceID", "dbi_resource_id"},
6345
{"DpdTimeoutAction", "DPDTimeoutAction", "dpdTimeoutAction", "dpd_timeout_action"},
64-
{"Iops", "IOPS", "iops", "iops"},
65-
{"IoPerformance", "IOPerformance", "ioPerformance", "io_performance"},
66-
{"Vlan", "VLAN", "vlan", "vlan"},
46+
{"Dynamic", "Dynamic", "dynamic", "dynamic"},
6747
{"Ecmp", "ECMP", "ecmp", "ecmp"},
48+
{"EdiPartyName", "EDIPartyName", "ediPartyName", "edi_party_name"},
49+
{"Editable", "Editable", "editable", "editable"},
6850
{"Ena", "ENA", "ena", "ena"},
69-
{"UUID", "UUID", "uuid", "uuid"},
51+
{"Examine", "Examine", "examine", "examine"},
52+
{"Family", "Family", "family", "family"},
53+
{"Id", "ID", "id", "id"},
54+
{"ID", "ID", "id", "id"},
55+
{"Identifier", "Identifier", "identifier", "identifier"},
56+
{"IoPerformance", "IOPerformance", "ioPerformance", "io_performance"},
57+
{"Iops", "IOPS", "iops", "iops"},
58+
{"Ip", "IP", "ip", "ip"},
59+
{"KeyId", "KeyID", "keyID", "key_id"},
60+
{"KeyID", "KeyID", "keyID", "key_id"},
61+
{"KeyIdentifier", "KeyIdentifier", "keyIdentifier", "key_identifier"},
62+
{"LdapServerMetadata", "LDAPServerMetadata", "ldapServerMetadata", "ldap_server_metadata"},
63+
{"MaxIdleConnectionsPercent", "MaxIdleConnectionsPercent", "maxIdleConnectionsPercent", "max_idle_connections_percent"},
64+
{"MultipartUpload", "MultipartUpload", "multipartUpload", "multipart_upload"},
7065
{"Nat", "NAT", "nat", "nat"},
7166
{"NatGateway", "NATGateway", "natGateway", "nat_gateway"},
7267
{"NativeAuditFieldsIncluded", "NativeAuditFieldsIncluded", "nativeAuditFieldsIncluded", "native_audit_fields_included"},
68+
{"NumberOfAmiToKeep", "NumberOfAMIToKeep", "numberOfAMIToKeep", "number_of_ami_to_keep"},
69+
{"Package", "Package", "package_", "package_"},
70+
{"RepositoryUriTest", "RepositoryURITest", "repositoryURITest", "repository_uri_test"},
71+
{"RequestedAmiVersion", "RequestedAMIVersion", "requestedAMIVersion", "requested_ami_version"},
72+
{"SSEKMSKeyID", "SSEKMSKeyID", "sseKMSKeyID", "sse_kms_key_id"},
73+
{"UUID", "UUID", "uuid", "uuid"},
74+
{"Vlan", "VLAN", "vlan", "vlan"},
7375
}
7476
for _, tc := range testCases {
7577
n := names.New(tc.original)

0 commit comments

Comments
 (0)