-
Notifications
You must be signed in to change notification settings - Fork 35
Adding the golangci-lint linter to the repository (jenkinsfile) #157
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
Conversation
…/apm-aws-lambda into add-linter-jenkinsfile
…/apm-aws-lambda into add-linter-jenkinsfile
Update on this PR : the linter was successfully implemented by commit 8907a3a. Failing Linter output
Corrections required for the linter to pass were done in ad51c2a. Successful Linter output
To run the linter on your own machine, just run the |
} | ||
|
||
extension.Log.Info("If the end-to-end tests are failing unexpectedly, please verify that Docker is running on your machine.") | ||
|
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'm assuming you put this because of a first-hand experience :)
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.
Exactly :D
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 just had a comment about using the shorthand ; err != nil {
That's not a necessary change, just up to you if you want to shave off some more lines of code.
assert.Equal(t, string(data), string(bytes)) | ||
assert.Equal(t, "gzip", r.Header.Get("Content-Encoding")) | ||
w.Write([]byte(`{"foo": "bar"}`)) | ||
_, err := w.Write([]byte(`{"foo": "bar"}`)) |
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.
You could use this syntax in a few places in this PR, if you want:
if _, err := w.Write([]byte(`{"foo": "bar"}`)); err != nil {
return
}
gw.Write([]byte("")) | ||
gw.Close() | ||
pw.Close() | ||
_, err := gw.Write([]byte("")) |
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.
for example,
if _, err := gw.Write([]byte("")); err != nil {
t.Fail()
return
}
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.
Resolves #153. The chosen linter is golangci-lint. For this third iteration, we install and run the linter as part of the Lint stage in the Jenkinsfile.