Skip to content

Commit

Permalink
chore: setup linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanad committed May 20, 2020
1 parent 1b066c6 commit 5f49aea
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor/
/bin/
/.vscode/
39 changes: 39 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
run:
deadline: 2m

linters:
disable-all: true
fast: false
enable:
- bodyclose
- deadcode
- depguard
- dupl
- goconst
- gocyclo
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck

linters-settings:
lll:
line-length: 110
goimports:
local-prefixes: "github.com/shaj13/go-guardian/"
issues:
exclude-use-default: false
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ cover: clean
GOFLAGS=-mod=vendor go test ./... -v -cover -coverprofile=${PWD}/cover/coverage.out

deploy-cover:
goveralls -coverprofile=${PWD}/cover/coverage.out -service=circle-ci -repotoken=$$COVERALLS_TOKEN
goveralls -coverprofile=${PWD}/cover/coverage.out -service=circle-ci -repotoken=$$COVERALLS_TOKEN

lint:
./bin/golangci-lint run -c .golangci.yml ./...

lint-fix:
./bin/golangci-lint run -c .golangci.yml ./... --fix
./bin/golangci-lint run -c .golangci.yml ./... --fix

0 comments on commit 5f49aea

Please sign in to comment.