Skip to content

Commit

Permalink
add golangci-lint to project
Browse files Browse the repository at this point in the history
fix #792
  • Loading branch information
masihtehrani committed May 10, 2020
1 parent ac46e07 commit 915553c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true

# print linter name in the end of issue text, default is true
print-linter-name: true

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- golint
- gomnd
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- rowserrcheck
- scopelint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- gocognit
- godox
- maligned
- prealloc
- wsl
- godot
- nestif
- gomodguard
- asciicheck

issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gomnd
- path: test
linters:
- gomnd
- dupl
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ verify:
hack/verify-gencode.sh
hack/verify-vendor.sh

lint: ## Lint the files
golangci-lint version
golangci-lint run pkg/kube pkg/version pkg/apis/...

verify-generated-yaml:
./hack/check-generated-yaml.sh

Expand Down

0 comments on commit 915553c

Please sign in to comment.