Skip to content

Commit

Permalink
chore: switch to golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Jan 20, 2019
1 parent 36f4177 commit c41132a
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
run:
deadline: 1m
tests: false
#skip-files:
# - ".*\\.gen\\.go"

linters-settings:
golint:
min-confidence: 0
maligned:
suggest-new: true
goconst:
min-len: 5
min-occurrences: 4
misspell:
locale: US

linters:
disable-all: true
enable:
- goconst
- misspell
- deadcode
- misspell
- structcheck
- errcheck
- unused
- varcheck
- staticcheck
- unconvert
- gofmt
- goimports
- golint
- ineffassign
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ install:
- wget https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/v1.5.0/.travis/install-protoc.sh && chmod +x install-protoc.sh && ./install-protoc.sh 3.4.0
- go get -u github.com/golang/protobuf/protoc-gen-go
- go get github.com/securego/gosec/cmd/gosec/...
- go get -u github.com/alecthomas/gometalinter
- gometalinter --install
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.12.2
script:
- make install
- make test
- make lint
- PATH=$PATH:$(pwd)/bin make lint
cache:
directories:
- $HOME/local
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ docker.push: docker.build

.PHONY: lint
lint:
gometalinter --disable-all --enable=errcheck --enable=vet --enable=vetshadow --enable=golint --enable=gosec --enable=ineffassign --enable=goconst --enable=goimports --enable=gofmt --exclude="Binds to all network interfaces" --exclude="should have comment" --enable=staticcheck --enable=gosimple --enable=misspell --deadline=120s . ./cmd/... ./helpers/...
golangci-lint run --verbose . ./helpers ./cmd/...
6 changes: 6 additions & 0 deletions assets/assets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/Users/moul/go/src/moul.io/protoc-gen-gotemplate/assets:
total used in directory 552 available 9223372036849978910
drwxr-xr-x 4 moul staff 128 Dec 9 11:31 .
lrwxr-xr-x 1 moul staff 33 Dec 9 11:31 .#web-editor.jpg -> [email protected]
drwxr-xr-x 21 moul staff 672 Sep 13 18:05 ..
-rw-r--r--@ 1 moul staff 280357 Oct 26 2017 web-editor.jpg
2 changes: 1 addition & 1 deletion encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/golang/protobuf/protoc-gen-go/plugin"
plugin_go "github.com/golang/protobuf/protoc-gen-go/plugin"

pgghelpers "moul.io/protoc-gen-gotemplate/helpers"
)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/protoc-gen-go/generator"
"github.com/golang/protobuf/protoc-gen-go/plugin"
plugin_go "github.com/golang/protobuf/protoc-gen-go/plugin"
ggdescriptor "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway/descriptor"

pgghelpers "moul.io/protoc-gen-gotemplate/helpers"
Expand Down

0 comments on commit c41132a

Please sign in to comment.