Skip to content

Commit

Permalink
deprecate <1.12.x, use golangci-lint (spf13#876)
Browse files Browse the repository at this point in the history
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
  • Loading branch information
umarcor committed Oct 14, 2019
1 parent 4363a8b commit da4dc39
Show file tree
Hide file tree
Showing 32 changed files with 491 additions and 600 deletions.
9 changes: 1 addition & 8 deletions .circleci/config.yml
Expand Up @@ -8,6 +8,7 @@ references:
run:
name: "All Commands"
command: |
export GO111MODULE=on
mkdir -p bin
curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.6/shellcheck
chmod +x bin/shellcheck
Expand All @@ -29,13 +30,6 @@ jobs:
- run:
name: "Check formatting"
command: diff -u <(echo -n) <(gofmt -d -s .)
go-previous:
docker:
- image: circleci/golang:1.11
working_directory: *workspace
steps:
- checkout
- *run_tests
go-latest:
docker:
- image: circleci/golang:latest
Expand All @@ -49,5 +43,4 @@ workflows:
main:
jobs:
- go-current
- go-previous
- go-latest
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text=auto
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -37,3 +37,6 @@ cobra.test

.idea/
*.iml

# test-generated files
cobra/cmd/testproject
25 changes: 25 additions & 0 deletions .golangci.yml
@@ -0,0 +1,25 @@
run:
deadline: 5m

linters:
enable:
- deadcode
- errcheck
- gas
- goconst
- goimports
- golint
- govet
- ineffassign
- interfacer
- maligned
- megacheck
- structcheck
- unconvert
- varcheck
enable-all: false
disable-all: true
# presets:
# - bugs
# - unused
fast: false
26 changes: 11 additions & 15 deletions .travis.yml
@@ -1,31 +1,27 @@
language: go

stages:
- diff
- lint
- test

go:
- 1.11.x
- 1.12.x
- 1.13.x
- tip

env:
- GO111MODULE=on

matrix:
allow_failures:
- go: tip
include:
- stage: diff
go: 1.13.x
script: diff -u <(echo -n) <(gofmt -d -s .)
env: GO111MODULE=on

before_install: go get -u github.com/kyoh86/richgo

script:
- richgo test -v ./...
- go build
- if [ -z $NOVET ]; then
diff -u <(echo -n) <(go vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint');
fi

matrix:
allow_failures:
- go: tip
include:
- stage: lint
go: 1.13.x
before_install: go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.19.1
script: golangci-lint run -v

0 comments on commit da4dc39

Please sign in to comment.