Skip to content

Commit

Permalink
Fix gometalinter flakes by setting CGO_ENABLED=0
Browse files Browse the repository at this point in the history
Also add a config file to explicitly define linters
  • Loading branch information
dnephin committed Jul 9, 2018
1 parent 95c941f commit a90054a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ jobs:
docker:
- image: supinf/gometalinter:latest
working_directory: /go/src/github.com/CircleCI-Public/circleci-cli
environment:
CGO_ENABLED: 0
steps:
- checkout
- run: gometalinter --deadline 60s --exclude=/usr/local/go/ --exclude ^vendor ./...
- run: gometalinter ./...

deploy:
executor: go
Expand Down
34 changes: 34 additions & 0 deletions .gometalinter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"Vendor": true,
"Deadline": "5m",
"Concurrency": 2,
"Linters": {
"gofmt": {"Command": "gofmt -l -s -w"},
"goimports": {"Command": "goimports -l -w"}
},

"Enable": [
"deadcode",
"errcheck",
"gas",
"goconst",
"gocyclo",
"gofmt",
"goimports",
"golint",
"gosimple",
"gotype",
"gotypex",
"ineffassign",
"interfacer",
"megacheck",
"misspell",
"nakedret",
"structcheck",
"unconvert",
"unparam",
"varcheck",
"vet",
"vetshadow"
]
}
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func MakeCommands() *cobra.Command {
// https://github.com/spf13/cobra/issues/340
// If you expose a command with `RunE`, and return an error from your
// command, then Cobra will print the error message, followed by the usage
// infomation for the command. This makes it really difficult to see what's
// information for the command. This makes it really difficult to see what's
// gone wrong. It usually prints a one line error message followed by 15
// lines of usage information.
// This flag disables that behaviour, so that if a comment fails, it prints
Expand Down

0 comments on commit a90054a

Please sign in to comment.