Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable gocritic Linter in golangcli.yml #1383

Merged
merged 1 commit into from
Dec 1, 2020
Merged

Conversation

Shubham82
Copy link
Contributor

Signed-off-by: Shubham82 [email protected]

Provide a description of what has been changed
This PR enable gocritic in .golangcli.yml and remove all the lint errors or warnings which shown on running golangci-lint run.

Checklist

PartiallyFixes #1158

@Shubham82
Copy link
Contributor Author

Hi @zroubalik @ahmelsayed @tomkerkhove @jeffhollan
Could you Please take a look.
Thanks.

adapter/main.go Outdated
@@ -113,7 +120,6 @@ func main() {

logger.Info(cmd.Message)
if err := cmd.Run(wait.NeverStop); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err := this will use a new variable for err not the one defined at the top of the main(){}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zroubalik for taking look in this.
Just want to know that is this expecting behaviour you have mentioned above
if err = cmd.Run(wait.NeverStop); err != nil {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

@@ -91,7 +91,8 @@ func parseAzureBlobMetadata(config *ScalerConfig) (*azureBlobMetadata, kedav1alp

// If the Use AAD Pod Identity is not present, or set to "none"
// then check for connection string
if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone {
switch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rewrite this switch to actually switch over config.PodIdentity?

@@ -104,8 +104,8 @@ func NewAzureLogAnalyticsScaler(config *ScalerConfig) (Scaler, error) {

func parseAzureLogAnalyticsMetadata(config *ScalerConfig) (*azureLogAnalyticsMetadata, error) {
meta := azureLogAnalyticsMetadata{}

if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone {
switch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rewrite this switch to actually switch over config.PodIdentity?

@@ -80,7 +80,8 @@ func parseAzureQueueMetadata(config *ScalerConfig) (*azureQueueMetadata, kedav1a

// If the Use AAD Pod Identity is not present, or set to "none"
// then check for connection string
if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone {
switch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rewrite this switch to actually switch over config.PodIdentity?

@@ -102,8 +102,8 @@ func parseAzureServiceBusMetadata(config *ScalerConfig) (*azureServiceBusMetadat
if meta.entityType == none {
return nil, fmt.Errorf("no service bus entity type set")
}

if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone {
switch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rewrite this switch to actually switch over config.PodIdentity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do this.

@Shubham82
Copy link
Contributor Author

Hi @zroubalik
I have addressed the comments, PTAL

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zroubalik zroubalik merged commit 88435e9 into kedacore:main Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants