Skip to content

Commit

Permalink
Merge pull request #365 from brycahta/moar-names
Browse files Browse the repository at this point in the history
Add `IPAM` and `TPM` to initialisms
  • Loading branch information
jaypipes authored Sep 14, 2022
2 parents 2944c87 + 21c6d42 commit 1da44f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/names/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ var (
// prefix-converted (should be "md5OfBody")
{"MD5Of", "MD5Of", "md5Of", regexp.MustCompile("M[dD]5Of", regexp.None)},
// Prevent "MultipartUpload" from becoming "MultIPartUpload"
{"Ip", "IP", "ip", regexp.MustCompile("Ip(?!art)", regexp.None)},
// and "IPAM" from becoming "IPam"
{"Ip", "IP", "ip", regexp.MustCompile("Ip(?!art|am)", regexp.None)},
// Model fields containing AMI will always capitalize the 'A' hence we don't
// have to look for words starting with a lowercase 'A'
{"Amis", "AMIs", "amis", regexp.MustCompile("Amis", regexp.None)},
Expand Down Expand Up @@ -110,6 +111,7 @@ var (
// Prevent "IOPS" from becoming "IOps"
{"Io", "IO", "io", regexp.MustCompile("Io(?!ps)", regexp.None)},
{"Iops", "IOPS", "iops", nil},
{"Ipam", "IPAM", "ipam", nil},
{"Json", "JSON", "json", nil},
{"Jwt", "JWT", "jwt", nil},
{"Kms", "KMS", "kms", nil},
Expand All @@ -133,6 +135,7 @@ var (
{"Ssl", "SSL", "ssl", nil},
{"Tcp", "TCP", "tcp", nil},
{"Tde", "TDE", "tde", nil},
{"Tpm", "TPM", "tpm", nil},
{"Tls", "TLS", "tls", nil},
{"Udp", "UDP", "udp", nil},
// Need to prevent "security" from becoming "SecURIty"
Expand Down
2 changes: 2 additions & 0 deletions pkg/names/names_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestNames(t *testing.T) {
{"IoPerformance", "IOPerformance", "ioPerformance", "io_performance"},
{"Iops", "IOPS", "iops", "iops"},
{"Ip", "IP", "ip", "ip"},
{"Ipam", "IPAM", "ipam", "ipam"},
{"Frame", "Frame", "frame", "frame"},
{"KeyId", "KeyID", "keyID", "key_id"},
{"KeyID", "KeyID", "keyID", "key_id"},
Expand All @@ -78,6 +79,7 @@ func TestNames(t *testing.T) {
{"Sqs", "SQS", "sqs", "sqs"},
{"SriovNetSupport", "SRIOVNetSupport", "sriovNetSupport", "sriov_net_support"},
{"SSEKMSKeyID", "SSEKMSKeyID", "sseKMSKeyID", "sse_kms_key_id"},
{"Tpm", "TPM", "tpm", "tpm"},
{"UUID", "UUID", "uuid", "uuid"},
{"Vlan", "VLAN", "vlan", "vlan"},
}
Expand Down

0 comments on commit 1da44f4

Please sign in to comment.