hazelcast / hazelcast-cloud-cli

CLI for Hazelcast Cloud
Apache License 2.0
2 stars 5 forks source link

Configure basic CLI build workflow featuring basic Vet and staticcheck checks #25

Closed pivovarit closed 3 years ago

yunussandikci commented 3 years ago

@pivovarit Could you please sync your branch with master then, we can run your workflow.

pivovarit commented 3 years ago

Keep in mind it's still a draft. Before we merge it, we need to fix some issues first:

cmd/awsPeering.go:15:5: var awsPeeringId should be awsPeeringID
48
cmd/awsPeering.go:17:5: var awsVpcId should be awsVpcID
49
cmd/azurePeering.go:15:5: var azurePeeringId should be azurePeeringID
50
cmd/azurePeering.go:16:5: var azureTenantId should be azureTenantID
51
cmd/azurePeering.go:17:5: var azureSubscriptionId should be azureSubscriptionID
52
cmd/enterpriseCluster.go:16:5: var enterpriseClusterId should be enterpriseClusterID
53
cmd/gcpPeering.go:15:5: var gcpPeeringId should be gcpPeeringID
54
cmd/gcpPeering.go:17:5: var gcpProjectId should be gcpProjectID
55
cmd/root.go:16:1: exported function Execute should have comment or be unexported
56
cmd/starterCluster.go:13:5: var starterClusterId should be starterClusterID
57
internal/configService.go:10:6: exported type ConfigKey should have comment or be unexported
58
internal/configService.go:13:2: const ApiKey should be APIKey
59
internal/configService.go:13:2: exported const ApiKey should have comment (or a comment on this block) or be unexported
60
internal/configService.go:14:2: const ApiSecret should be APISecret
61
internal/configService.go:18:6: exported type ConfigService should have comment or be unexported
62
internal/configService.go:28:1: exported function NewConfigService should have comment or be unexported
63
internal/configService.go:67:2: var configJson should be configJSON
64
internal/hazelcastCloud.go:11:1: exported function NewClient should have comment or be unexported
65
internal/hazelcastCloud.go:31:1: exported function Login should have comment or be unexported
66
internal/hazelcastCloud.go:32:6: var apiUrl should be apiURL
67
internal/hazelcastCloud.go:39:1: exported function Validate should have comment or be unexported
68
internal/updaterService.go:19:5: exported var GithubRepository should have comment or be unexported
69
internal/updaterService.go:20:5: exported var Version should have comment or be unexported
70
internal/updaterService.go:21:5: exported var Distribution should have comment or be unexported
71
internal/updaterService.go:23:6: exported type UpdateService should have comment or be unexported
72
internal/updaterService.go:27:1: exported function NewUpdaterService should have comment or be unexported
73
internal/updaterService.go:32:1: exported method UpdateService.Update should have comment or be unexported
74
internal/updaterService.go:47:2: var browserDownloadUrl should be browserDownloadURL
75
internal/updaterService.go:84:1: exported method UpdateService.Run should have comment or be unexported
76
internal/updaterService.go:88:1: exported method UpdateService.Clean should have comment or be unexported
77
internal/updaterService.go:92:1: exported method UpdateService.Check should have comment or be unexported
78
internal/updaterService.go:160:6: exported type Release should have comment or be unexported
79
internal/updaterService.go:164:6: exported type Asset should have comment or be unexported
80
internal/updaterService.go:166:2: struct field BrowserDownloadUrl should be BrowserDownloadURL
81
service/awsPeeringService.go:14:6: exported type AwsPeeringService should have comment or be unexported
82
service/awsPeeringService.go:21:6: exported type AwsCustomerPeeringProperties should have comment or be unexported
83
service/awsPeeringService.go:22:2: struct field SubAccountId should be SubAccountID
84
service/awsPeeringService.go:23:2: struct field ClusterId should be ClusterID
85
service/awsPeeringService.go:25:2: struct field VpcId should be VpcID
86
service/awsPeeringService.go:29:1: exported function NewAwsPeeringService should have comment or be unexported
87
service/awsPeeringService.go:36:1: exported method AwsPeeringService.Create should have comment or be unexported
88
service/awsPeeringService.go:49:2: var peeringConnectionId should be peeringConnectionID
89
service/awsPeeringService.go:115:41: method parameter peeringConnectionId should be peeringConnectionID
90
service/awsPeeringService.go:154:9: range var routeTableId should be routeTableID
91
service/azurePeeringService.go:26:6: exported type AzurePeeringService should have comment or be unexported
92
service/azurePeeringService.go:39:6: exported type AzureCustomerPeeringProperties should have comment or be unexported
93
service/azurePeeringService.go:40:2: struct field ClusterId should be ClusterID
94
service/azurePeeringService.go:42:2: struct field SubscriptionId should be SubscriptionID
95
service/azurePeeringService.go:43:2: struct field TenantId should be TenantID
96
service/azurePeeringService.go:47:1: exported function NewAzurePeeringService should have comment or be unexported
97
service/azurePeeringService.go:54:1: exported method AzurePeeringService.Create should have comment or be unexported
98
service/azurePeeringService.go:100:3: struct field ClusterId should be ClusterID
99
service/azurePeeringService.go:101:3: struct field PeeringConnectionId should be PeeringConnectionID
100
service/azurePeeringService.go:102:3: struct field VnetId should be VnetID
101
service/azurePeeringService.go:190:12: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
102
service/azurePeeringService.go:198:2: var networkContributorRoleId should be networkContributorRoleID
103
service/azurePeeringService.go:210:10: if block ends with a return statement, so drop this else and outdent its block
104
service/azurePeeringService.go:304:31: method getCustomerVnetId should be getCustomerVnetID
105
service/azurePeeringService.go:309:31: method getHazelcastVnetId should be getHazelcastVnetID
106
service/gcpPeeringService.go:12:6: exported type GcpPeeringService should have comment or be unexported
107
service/gcpPeeringService.go:17:6: exported type GcpCustomerPeeringProperties should have comment or be unexported
108
service/gcpPeeringService.go:18:2: struct field ClusterId should be ClusterID
109
service/gcpPeeringService.go:19:2: struct field ProjectId should be ProjectID
110
service/gcpPeeringService.go:23:1: exported function NewGcpPeeringService should have comment or be unexported
111
service/gcpPeeringService.go:29:1: exported method GcpPeeringService.Create should have comment or be unexported
112
Found 84 lint suggestions; failing.
113
util/cluster.go:14:1: exported function AugmentStarterHazelcastVersion should have comment or be unexported
114
util/cluster.go:21:25: error strings should not be capitalized or end with punctuation or a newline
115
util/cluster.go:25:1: exported function AugmentStarterClusterType should have comment or be unexported
116
util/cluster.go:36:25: error strings should not be capitalized or end with punctuation or a newline
117
util/loadingIndicator.go:9:7: exported const Frames should have comment or be unexported
118
util/loadingIndicator.go:10:7: exported const ClearLine should have comment or be unexported
119
util/loadingIndicator.go:11:7: exported const ProgressBarWidth should have comment or be unexported
120
util/loadingIndicator.go:13:6: exported type LoadingIndicator should have comment or be unexported
121
util/loadingIndicator.go:22:1: exported function NewLoadingIndicator should have comment or be unexported
122
util/loadingIndicator.go:30:1: exported method LoadingIndicator.SetStep should have comment or be unexported
123
util/loadingIndicator.go:35:1: exported method LoadingIndicator.Start should have comment or be unexported
124
util/loadingIndicator.go:49:1: exported method LoadingIndicator.Stop should have comment or be unexported
125
util/loadingIndicator.go:80:9: if block ends with a return statement, so drop this else and outdent its block
126
util/print.go:13:6: exported type PrintStyle should have comment or be unexported
127
util/print.go:16:2: exported const PrintStyleDefault should have comment (or a comment on this block) or be unexported
128
util/print.go:18:2: const PrintStyleHtml should be PrintStyleHTML
129
util/print.go:20:2: const PrintStyleJson should be PrintStyleJSON
130
util/print.go:23:6: exported type PrintRequest should have comment or be unexported
131
util/print.go:30:1: exported function Print should have comment or be unexported
pivovarit commented 3 years ago

Replaced golint with more relevant staticcheck which yielded this results:

cmd/availabilityZone.go:71:2: this value of err is never used (SA4006)
46
cmd/availabilityZone.go:72:2: this value of err is never used (SA4006)
47
cmd/availabilityZone.go:73:2: this value of err is never used (SA4006)
48
service/azurePeeringService.go:190:12: should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028)
49
util/cluster.go:21:14: error strings should not be capitalized (ST1005)
50
util/cluster.go:21:14: error strings should not end with punctuation or a newline (ST1005)
51
util/cluster.go:36:14: error strings should not be capitalized (ST1005)
52
util/cluster.go:36:14: error strings should not end with punctuation or a newline (ST1005)
53
util/cluster.go:68:16: unnecessary use of fmt.Sprintf (S1039)
54
util/cluster.go:79:16: unnecessary use of fmt.Sprintf (S1039)
55
util/cluster.go:88:16: unnecessary use of fmt.Sprintf (S1039)
56
util/cluster.go:96:16: unnecessary use of fmt.Sprintf (S1039)
57
util/cluster.go:109:17: unnecessary use of fmt.Sprintf (S1039)
58
util/cluster.go:113:17: unnecessary use of fmt.Sprintf (S1039)
59
util/cluster.go:117:17: unnecessary use of fmt.Sprintf (S1039)
60
util/cluster.go:125:16: unnecessary use of fmt.Sprintf (S1039)
61
util/cluster.go:127:16: unnecessary use of fmt.Sprintf (S1039)
62
util/cluster.go:130:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
63
util/cluster.go:136:18: unnecessary use of fmt.Sprintf (S1039)
64
util/cluster.go:144:18: unnecessary use of fmt.Sprintf (S1039)
65
util/cluster.go:162:16: unnecessary use of fmt.Sprintf (S1039)
66
util/cluster.go:165:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
67
util/cluster.go:175:16: unnecessary use of fmt.Sprintf (S1039)
68
util/cluster.go:178:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
69
util/cluster.go:188:16: unnecessary use of fmt.Sprintf (S1039)
70
util/cluster.go:191:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
71
util/cluster.go:202:16: unnecessary use of fmt.Sprintf (S1039)
72
util/cluster.go:205:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
73
util/cluster.go:220:16: unnecessary use of fmt.Sprintf (S1039)
74
util/cluster.go:223:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
75
util/cluster.go:233:16: unnecessary use of fmt.Sprintf (S1039)
76
util/cluster.go:236:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
77
util/cluster.go:244:16: unnecessary use of fmt.Sprintf (S1039)
78
util/cluster.go:247:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
79
util/cluster.go:259:16: unnecessary use of fmt.Sprintf (S1039)
80
util/cluster.go:262:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
81
util/cluster.go:271:16: unnecessary use of fmt.Sprintf (S1039)
82
util/cluster.go:274:17: the argument is already a string, there's no need to use fmt.Sprintf (S1025)
pivovarit commented 3 years ago

@yunussandikci I made linter checks optional for now. Will create an issue to fix the actual issues they found, then we enable them