Skip to content

Commit f57c17d

Browse files
committed
Made lint even more happy by adjusting naming conventions and having VSCode not complain at all
1 parent fdb9b3d commit f57c17d

12 files changed

+133
-133
lines changed

databricks/azure_auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ func (a *AzureAuth) getWorkspaceID(config *service.DBApiClientConfig) error {
8787
"Authorization": "Bearer " + a.ManagementToken,
8888
}
8989
type apiVersion struct {
90-
ApiVersion string `url:"api-version"`
90+
APIVersion string `url:"api-version"`
9191
}
9292
uriPayload := apiVersion{
93-
ApiVersion: "2018-04-01",
93+
APIVersion: "2018-04-01",
9494
}
9595
var responseMap map[string]interface{}
9696
resp, err := service.PerformQuery(config, http.MethodGet, url, "2.0", headers, false, true, uriPayload, nil)

databricks/resource_databricks_azure_adls_gen2_mount_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
func TestAccAzureAdlsGen2Mount_correctly_mounts(t *testing.T) {
17-
terraformToApply := testAccAzureAdlsGen2Mount_correctly_mounts()
17+
terraformToApply := testAccAzureAdlsGen2MountCorrectlyMounts()
1818

1919
resource.Test(t, resource.TestCase{
2020
Providers: testAccProviders,
@@ -27,7 +27,7 @@ func TestAccAzureAdlsGen2Mount_correctly_mounts(t *testing.T) {
2727
}
2828

2929
func TestAccAzureAdlsGen2Mount_cluster_deleted_correctly_mounts(t *testing.T) {
30-
terraformToApply := testAccAzureAdlsGen2Mount_correctly_mounts()
30+
terraformToApply := testAccAzureAdlsGen2MountCorrectlyMounts()
3131
var cluster model.ClusterInfo
3232

3333
resource.Test(t, resource.TestCase{
@@ -50,7 +50,7 @@ func TestAccAzureAdlsGen2Mount_cluster_deleted_correctly_mounts(t *testing.T) {
5050
}
5151

5252
func TestAccAzureAdlsGen2Mount_capture_error(t *testing.T) {
53-
terraformToApply := testAccAzureAdlsGen2Mount_capture_error()
53+
terraformToApply := testAccAzureAdlsGen2MountCaptureError()
5454

5555
resource.Test(t, resource.TestCase{
5656
Providers: testAccProviders,
@@ -65,7 +65,7 @@ func TestAccAzureAdlsGen2Mount_capture_error(t *testing.T) {
6565
})
6666
}
6767

68-
func testAccAzureAdlsGen2Mount_correctly_mounts() string {
68+
func testAccAzureAdlsGen2MountCorrectlyMounts() string {
6969
clientID := os.Getenv("ARM_CLIENT_ID")
7070
clientSecret := os.Getenv("ARM_CLIENT_SECRET")
7171
tenantID := os.Getenv("ARM_TENANT_ID")
@@ -129,7 +129,7 @@ func testAccAzureAdlsGen2Mount_correctly_mounts() string {
129129
return definition
130130
}
131131

132-
func testAccAzureAdlsGen2Mount_capture_error() string {
132+
func testAccAzureAdlsGen2MountCaptureError() string {
133133
clientID := os.Getenv("ARM_CLIENT_ID")
134134
clientSecret := os.Getenv("ARM_CLIENT_SECRET")
135135
tenantID := os.Getenv("ARM_TENANT_ID")

databricks/resource_databricks_azure_blob_mount_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
func TestAccAzureBlobMount_correctly_mounts(t *testing.T) {
16-
terraformToApply := testAccAzureBlobMount_correctly_mounts()
16+
terraformToApply := testAccAzureBlobMountCorrectlyMounts()
1717
var clusterInfo model.ClusterInfo
1818
var azureBlobMount AzureBlobMount
1919

@@ -23,8 +23,8 @@ func TestAccAzureBlobMount_correctly_mounts(t *testing.T) {
2323
{
2424
Config: terraformToApply,
2525
Check: resource.ComposeTestCheckFunc(
26-
testAccAzureBlobMount_cluster_exists("databricks_cluster.cluster", &clusterInfo),
27-
testAccAzureBlobMount_mount_exists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
26+
testAccAzureBlobMountClusterExists("databricks_cluster.cluster", &clusterInfo),
27+
testAccAzureBlobMountMountExists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
2828
),
2929
},
3030
{
@@ -35,15 +35,15 @@ func TestAccAzureBlobMount_correctly_mounts(t *testing.T) {
3535
},
3636
Config: terraformToApply,
3737
Check: resource.ComposeTestCheckFunc(
38-
testAccAzureBlobMount_mount_exists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
38+
testAccAzureBlobMountMountExists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
3939
),
4040
},
4141
},
4242
})
4343
}
4444

4545
func TestAccAzureBlobMount_cluster_deleted_correctly_mounts(t *testing.T) {
46-
terraformToApply := testAccAzureBlobMount_correctly_mounts()
46+
terraformToApply := testAccAzureBlobMountCorrectlyMounts()
4747
var clusterInfo model.ClusterInfo
4848
var azureBlobMount AzureBlobMount
4949

@@ -53,8 +53,8 @@ func TestAccAzureBlobMount_cluster_deleted_correctly_mounts(t *testing.T) {
5353
{
5454
Config: terraformToApply,
5555
Check: resource.ComposeTestCheckFunc(
56-
testAccAzureBlobMount_cluster_exists("databricks_cluster.cluster", &clusterInfo),
57-
testAccAzureBlobMount_mount_exists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
56+
testAccAzureBlobMountClusterExists("databricks_cluster.cluster", &clusterInfo),
57+
testAccAzureBlobMountMountExists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
5858
),
5959
},
6060
{
@@ -65,14 +65,14 @@ func TestAccAzureBlobMount_cluster_deleted_correctly_mounts(t *testing.T) {
6565
},
6666
Config: terraformToApply,
6767
Check: resource.ComposeTestCheckFunc(
68-
testAccAzureBlobMount_mount_exists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
68+
testAccAzureBlobMountMountExists("databricks_azure_blob_mount.mount", &azureBlobMount, &clusterInfo),
6969
),
7070
},
7171
},
7272
})
7373
}
7474

75-
func testAccAzureBlobMount_cluster_exists(n string, clusterInfo *model.ClusterInfo) resource.TestCheckFunc {
75+
func testAccAzureBlobMountClusterExists(n string, clusterInfo *model.ClusterInfo) resource.TestCheckFunc {
7676
return func(s *terraform.State) error {
7777
// find the corresponding state object
7878
rs, ok := s.RootModule().Resources[n]
@@ -93,7 +93,7 @@ func testAccAzureBlobMount_cluster_exists(n string, clusterInfo *model.ClusterIn
9393
}
9494
}
9595

96-
func testAccAzureBlobMount_mount_exists(n string, azureBlobMount *AzureBlobMount, clusterInfo *model.ClusterInfo) resource.TestCheckFunc {
96+
func testAccAzureBlobMountMountExists(n string, azureBlobMount *AzureBlobMount, clusterInfo *model.ClusterInfo) resource.TestCheckFunc {
9797
return func(s *terraform.State) error {
9898
// find the corresponding state object
9999
rs, ok := s.RootModule().Resources[n]
@@ -113,9 +113,9 @@ func testAccAzureBlobMount_mount_exists(n string, azureBlobMount *AzureBlobMount
113113
tokenSecretScope, tokenSecretKey)
114114

115115
client := testAccProvider.Meta().(*service.DBApiClient)
116-
cluster_id := clusterInfo.ClusterID
116+
clusterID := clusterInfo.ClusterID
117117

118-
message, err := blobMount.Read(client, cluster_id)
118+
message, err := blobMount.Read(client, clusterID)
119119
if err != nil {
120120
return fmt.Errorf("Error reading the mount %s: error %s", message, err)
121121
}
@@ -126,7 +126,7 @@ func testAccAzureBlobMount_mount_exists(n string, azureBlobMount *AzureBlobMount
126126
}
127127
}
128128

129-
func testAccAzureBlobMount_correctly_mounts() string {
129+
func testAccAzureBlobMountCorrectlyMounts() string {
130130
clientID := os.Getenv("ARM_CLIENT_ID")
131131
clientSecret := os.Getenv("ARM_CLIENT_SECRET")
132132
tenantID := os.Getenv("ARM_TENANT_ID")

databricks/resource_databricks_mws_credentials.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,30 @@ func resourceMWSCredentialsCreate(d *schema.ResourceData, m interface{}) error {
5151
client := m.(*service.DBApiClient)
5252
credentialsName := d.Get("credentials_name").(string)
5353
roleArn := d.Get("role_arn").(string)
54-
mwsAcctId := d.Get("account_id").(string)
55-
credentials, err := client.MWSCredentials().Create(mwsAcctId, credentialsName, roleArn)
54+
mwsAcctID := d.Get("account_id").(string)
55+
credentials, err := client.MWSCredentials().Create(mwsAcctID, credentialsName, roleArn)
5656
if err != nil {
5757
return err
5858
}
59-
credentialsResourceId := PackagedMWSIds{
60-
MwsAcctId: mwsAcctId,
61-
ResourceId: credentials.CredentialsID,
59+
credentialsResourceID := PackagedMWSIds{
60+
MwsAcctID: mwsAcctID,
61+
ResourceID: credentials.CredentialsID,
6262
}
63-
d.SetId(packMWSAccountId(credentialsResourceId))
63+
d.SetId(packMWSAccountID(credentialsResourceID))
6464
return resourceMWSCredentialsRead(d, m)
6565
}
6666

6767
func resourceMWSCredentialsRead(d *schema.ResourceData, m interface{}) error {
6868
id := d.Id()
6969
client := m.(*service.DBApiClient)
70-
packagedMwsId, err := unpackMWSAccountId(id)
70+
packagedMwsID, err := unpackMWSAccountID(id)
7171
if err != nil {
7272
return err
7373
}
74-
credentials, err := client.MWSCredentials().Read(packagedMwsId.MwsAcctId, packagedMwsId.ResourceId)
74+
credentials, err := client.MWSCredentials().Read(packagedMwsID.MwsAcctID, packagedMwsID.ResourceID)
7575
if err != nil {
7676
if isMWSCredentialsMissing(err.Error()) {
77-
log.Printf("Missing e2 credentials with id: %s.", packagedMwsId.ResourceId)
77+
log.Printf("Missing e2 credentials with id: %s.", packagedMwsID.ResourceID)
7878
d.SetId("")
7979
return nil
8080
}
@@ -106,11 +106,11 @@ func resourceMWSCredentialsRead(d *schema.ResourceData, m interface{}) error {
106106
func resourceMWSCredentialsDelete(d *schema.ResourceData, m interface{}) error {
107107
id := d.Id()
108108
client := m.(*service.DBApiClient)
109-
packagedMwsId, err := unpackMWSAccountId(id)
109+
packagedMwsID, err := unpackMWSAccountID(id)
110110
if err != nil {
111111
return err
112112
}
113-
err = client.MWSCredentials().Delete(packagedMwsId.MwsAcctId, packagedMwsId.ResourceId)
113+
err = client.MWSCredentials().Delete(packagedMwsID.MwsAcctID, packagedMwsID.ResourceID)
114114
return err
115115
}
116116

databricks/resource_databricks_mws_credentials_mws_test.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ func TestAccMWSCredentials(t *testing.T) {
1717
// the acctest package includes many helpers such as RandStringFromCharSet
1818
// See https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/acctest
1919
//scope := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
20-
mwsAcctId := os.Getenv("DATABRICKS_MWS_ACCT_ID")
20+
mwsAcctID := os.Getenv("DATABRICKS_MWS_ACCT_ID")
2121
mwsHost := os.Getenv("DATABRICKS_MWS_HOST")
22-
awsAcctId := "999999999999"
22+
awsAcctID := "999999999999"
2323
credentialsName := "test-mws-credentials-tf"
2424
roleName := "terraform-creds-role"
2525

@@ -29,26 +29,26 @@ func TestAccMWSCredentials(t *testing.T) {
2929
Steps: []resource.TestStep{
3030
{
3131
// use a dynamic configuration with the random name from above
32-
Config: testMWSCredentialsCreate(mwsAcctId, mwsHost, awsAcctId, roleName, credentialsName),
32+
Config: testMWSCredentialsCreate(mwsAcctID, mwsHost, awsAcctID, roleName, credentialsName),
3333
// compose a basic test, checking both remote and local values
3434
Check: resource.ComposeTestCheckFunc(
3535
// query the API to retrieve the tokenInfo object
3636
testMWSCredentialsResourceExists("databricks_mws_credentials.my_e2_credentials", &MWSCredentials, t),
3737
// verify local values
38-
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "account_id", mwsAcctId),
38+
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "account_id", mwsAcctID),
3939
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "credentials_name", credentialsName),
4040
),
4141
Destroy: false,
4242
},
4343
{
4444
// use a dynamic configuration with the random name from above
45-
Config: testMWSCredentialsCreate(mwsAcctId, mwsHost, awsAcctId, roleName, credentialsName),
45+
Config: testMWSCredentialsCreate(mwsAcctID, mwsHost, awsAcctID, roleName, credentialsName),
4646
// compose a basic test, checking both remote and local values
4747
Check: resource.ComposeTestCheckFunc(
4848
// query the API to retrieve the tokenInfo object
4949
testMWSCredentialsResourceExists("databricks_mws_credentials.my_e2_credentials", &MWSCredentials, t),
5050
// verify local values
51-
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "account_id", mwsAcctId),
51+
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "account_id", mwsAcctID),
5252
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "credentials_name", credentialsName),
5353
),
5454
ExpectNonEmptyPlan: false,
@@ -63,11 +63,11 @@ func TestAccMWSCredentials(t *testing.T) {
6363
}
6464
},
6565
// use a dynamic configuration with the random name from above
66-
Config: testMWSCredentialsCreate(mwsAcctId, mwsHost, awsAcctId, roleName, credentialsName),
66+
Config: testMWSCredentialsCreate(mwsAcctID, mwsHost, awsAcctID, roleName, credentialsName),
6767
// compose a basic test, checking both remote and local values
6868
Check: resource.ComposeTestCheckFunc(
6969
// verify local values
70-
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "account_id", mwsAcctId),
70+
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "account_id", mwsAcctID),
7171
resource.TestCheckResourceAttr("databricks_mws_credentials.my_e2_credentials", "credentials_name", credentialsName),
7272
),
7373
Destroy: false,
@@ -83,11 +83,11 @@ func testMWSCredentialsResourceDestroy(s *terraform.State) error {
8383
if rs.Type != "databricks_mws_credentials" {
8484
continue
8585
}
86-
packagedMWSIds, err := unpackMWSAccountId(rs.Primary.ID)
86+
packagedMWSIds, err := unpackMWSAccountID(rs.Primary.ID)
8787
if err != nil {
8888
return err
8989
}
90-
_, err = client.MWSCredentials().Read(packagedMWSIds.MwsAcctId, packagedMWSIds.ResourceId)
90+
_, err = client.MWSCredentials().Read(packagedMWSIds.MwsAcctID, packagedMWSIds.ResourceID)
9191
if err != nil {
9292
return nil
9393
}
@@ -107,11 +107,11 @@ func testMWSCredentialsResourceExists(n string, mwsCreds *model.MWSCredentials,
107107

108108
// retrieve the configured client from the test setup
109109
conn := getMWSClient()
110-
packagedMWSIds, err := unpackMWSAccountId(rs.Primary.ID)
110+
packagedMWSIds, err := unpackMWSAccountID(rs.Primary.ID)
111111
if err != nil {
112112
return err
113113
}
114-
resp, err := conn.MWSCredentials().Read(packagedMWSIds.MwsAcctId, packagedMWSIds.ResourceId)
114+
resp, err := conn.MWSCredentials().Read(packagedMWSIds.MwsAcctID, packagedMWSIds.ResourceID)
115115
if err != nil {
116116
return err
117117
}
@@ -122,7 +122,7 @@ func testMWSCredentialsResourceExists(n string, mwsCreds *model.MWSCredentials,
122122
}
123123
}
124124

125-
func testMWSCredentialsCreate(mwsAcctId, mwsHost, awsAcctId, roleName, credentialsName string) string {
125+
func testMWSCredentialsCreate(mwsAcctID, mwsHost, awsAcctID, roleName, credentialsName string) string {
126126
return fmt.Sprintf(`
127127
provider "databricks" {
128128
host = "%s"
@@ -133,5 +133,5 @@ func testMWSCredentialsCreate(mwsAcctId, mwsHost, awsAcctId, roleName, credentia
133133
credentials_name = "%s"
134134
role_arn = "arn:aws:iam::%s:role/%s"
135135
}
136-
`, mwsHost, mwsAcctId, credentialsName, awsAcctId, roleName)
136+
`, mwsHost, mwsAcctID, credentialsName, awsAcctID, roleName)
137137
}

databricks/resource_databricks_mws_networks.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,31 +89,31 @@ func resourceMWSNetworks() *schema.Resource {
8989
func resourceMWSNetworkCreate(d *schema.ResourceData, m interface{}) error {
9090
client := m.(*service.DBApiClient)
9191
networkName := d.Get("network_name").(string)
92-
mwsAcctId := d.Get("account_id").(string)
92+
mwsAcctID := d.Get("account_id").(string)
9393
VPCID := d.Get("vpc_id").(string)
9494
subnetIds := convertListInterfaceToString(d.Get("subnet_ids").(*schema.Set).List())
9595
securityGroupIds := convertListInterfaceToString(d.Get("security_group_ids").(*schema.Set).List())
9696

97-
network, err := client.MWSNetworks().Create(mwsAcctId, networkName, VPCID, subnetIds, securityGroupIds)
97+
network, err := client.MWSNetworks().Create(mwsAcctID, networkName, VPCID, subnetIds, securityGroupIds)
9898
if err != nil {
9999
return err
100100
}
101-
networksResourceId := PackagedMWSIds{
102-
MwsAcctId: mwsAcctId,
103-
ResourceId: network.NetworkID,
101+
networksResourceID := PackagedMWSIds{
102+
MwsAcctID: mwsAcctID,
103+
ResourceID: network.NetworkID,
104104
}
105-
d.SetId(packMWSAccountId(networksResourceId))
105+
d.SetId(packMWSAccountID(networksResourceID))
106106
return resourceMWSNetworkRead(d, m)
107107
}
108108

109109
func resourceMWSNetworkRead(d *schema.ResourceData, m interface{}) error {
110110
id := d.Id()
111111
client := m.(*service.DBApiClient)
112-
packagedMwsId, err := unpackMWSAccountId(id)
112+
packagedMwsID, err := unpackMWSAccountID(id)
113113
if err != nil {
114114
return err
115115
}
116-
network, err := client.MWSNetworks().Read(packagedMwsId.MwsAcctId, packagedMwsId.ResourceId)
116+
network, err := client.MWSNetworks().Read(packagedMwsID.MwsAcctID, packagedMwsID.ResourceID)
117117
if err != nil {
118118
if isMWSNetworkMissing(err.Error()) {
119119
log.Printf("Missing e2 network with id: %s.", id)
@@ -173,11 +173,11 @@ func resourceMWSNetworkRead(d *schema.ResourceData, m interface{}) error {
173173
func resourceMWSNetworkDelete(d *schema.ResourceData, m interface{}) error {
174174
id := d.Id()
175175
client := m.(*service.DBApiClient)
176-
packagedMwsId, err := unpackMWSAccountId(id)
176+
packagedMwsID, err := unpackMWSAccountID(id)
177177
if err != nil {
178178
return err
179179
}
180-
err = client.MWSNetworks().Delete(packagedMwsId.MwsAcctId, packagedMwsId.ResourceId)
180+
err = client.MWSNetworks().Delete(packagedMwsID.MwsAcctID, packagedMwsID.ResourceID)
181181
return err
182182
}
183183

0 commit comments

Comments
 (0)