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

Add golangci-lint to CI #114

Merged
merged 2 commits into from
Jun 4, 2019
Merged

Add golangci-lint to CI #114

merged 2 commits into from
Jun 4, 2019

Conversation

cep21
Copy link
Contributor

@cep21 cep21 commented May 31, 2019

We should also task to improve these lint failures until the linter passes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@luluzhao
Copy link
Contributor

luluzhao commented Jun 3, 2019

@cep21 build is broken which said it cannot parse .travis.yaml file. Could you check the format to make sure it can be built?

.travis.yml Outdated
@@ -41,10 +41,12 @@ install:
else
go get;
fi
- [ $DEP_MANAGEMENT_TOOL == "DEP" ] || go get github.com/golangci/golangci-lint/cmd/[email protected]
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering what you want to achieve here. Do you mean if $DEP_MANAGEMENT_TOOL == "DEP" and then go get ...?

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'm not sure if we need to run a linter in every version of go, or just the latest version of Go. A lot of the linting tools are newer and only work on the latest version of Go.

I think it makes a lot of sense to run unit tests or integration tests on every version of Go, but unsure what advantage we get out of limiting linters to just those supported on 1.9.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I misunderstood your question!

I'm trying to install golangci-lint only if modules are enabled, which is only if we're using modules and not dep.

Copy link
Contributor

Choose a reason for hiding this comment

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

in this case, we can make if else condition(there are some example inside the .travis.yaml file)

@cep21
Copy link
Contributor Author

cep21 commented Jun 3, 2019

build is broken which said it cannot parse .travis.yaml file.

Ah! Where did you find that link (I cannot find this build on https://travis-ci.org/aws/aws-xray-sdk-go/pull_requests)

@luluzhao
Copy link
Contributor

luluzhao commented Jun 3, 2019

@cep21 it is inside the Requests and here is the link: https://travis-ci.org/aws/aws-xray-sdk-go/requests

Jack Lindamood added 2 commits June 3, 2019 21:16
There are lint failures that cause the linter to fail.  We should try to
continuously improve the codebase until we resolve these linter issues.
@luluzhao
Copy link
Contributor

luluzhao commented Jun 4, 2019

@cep21 thanks for the update and it works now. I am wondering you are you going to address the result of running the golangci-lint?

@cep21
Copy link
Contributor Author

cep21 commented Jun 4, 2019

There is a lot of output. Some don't matter and we can take out of the linter (like math/rand instead of crypto/rand ), but some are things we should resolve. I worry it would be too big a diff to do everything at once, but having the list at least in CI can give us a target to reach. What are your thoughts?

@luluzhao
Copy link
Contributor

luluzhao commented Jun 4, 2019

@cep21 Yeah, I agree with you. A big diff can be too hard to read. Let's break down into several PRs to cover them. :)

@luluzhao luluzhao merged commit 7180daa into aws:master Jun 4, 2019
@cep21 cep21 deleted the cilint branch June 11, 2019 00:29
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