-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Linting: include sub packages #2219
Conversation
@@ -163,7 +163,7 @@ func TestAzureFindValidAccessTokenForTenant_ValidFromCloudShell(t *testing.T) { | |||
t.Fatalf("Expected the Client ID to be %q but got %q", expectedToken.ClientID, token.ClientID) | |||
} | |||
|
|||
if token.IsCloudShell != true { | |||
if token.IsCloudShell { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this inverted the boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It sure did
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I'd like to hold off on this PR until #2199 is merged; since otherwise there's going to be a ton of merge conflicts which'll be hard to resolve - WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katbyte I think this should be safe to git reset HEAD~1 && [lint]
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated and ready to go
tokensPath, err := cli.AccessTokensPath() | ||
if err != nil { | ||
return fmt.Errorf("Error loading the Tokens Path from the Azure CLI: %+v", err) | ||
tokensPath, err2 := cli.AccessTokensPath() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its fair to exclude the shadowing rule for err
as its just so common, so you don't have to do this. I think using some other name for an error than err
should be avoided if at all possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, however there was one or two cases i saw where the wrong error could have been printed out.
Is there an easy way to exclude shadow errors just pertaining to err?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM 👍
@@ -26,7 +26,7 @@ func ResponseErrorIsRetryable(err error) bool { | |||
return false | |||
} | |||
|
|||
func responseWasStatusCode(resp autorest.Response, statusCode int) bool { | |||
func responseWasStatusCode(resp autorest.Response, statusCode int) bool { // nolint: unparam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which parameter is unused here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==> Checking source code against linters...
azurerm/utils/response.go:29:52:warning: parameter statusCode always receives 404 (unparam)
make: *** [lint] Error 1
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
No description provided.