dev: enable whitespace, dogsled, funlen on the repo (#746)

This commit is contained in:
Isaev Denis 2019-09-25 18:08:28 +03:00 committed by GitHub
parent 86d7c05c6b
commit 2cadaf5beb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View File

@ -41,6 +41,9 @@ linters-settings:
disabled-checks:
- wrapperFunc
- dupImport # https://github.com/go-critic/go-critic/issues/845
funlen:
lines: 100
statements: 50
linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
@ -49,11 +52,10 @@ linters:
- bodyclose
- deadcode
- depguard
# - dogsled - TODO: enable it when golangci.com will support it.
- dogsled
- dupl
- errcheck
# - funlen - TODO: enable it when golangci.com will support it.
# - godox - TODO: enable it when golangci.com will support it.
- funlen
- gochecknoinits
- goconst
- gocritic
@ -78,9 +80,10 @@ linters:
- unparam
- unused
- varcheck
# - whitespace - TODO: enable it when golangci.com will support it.
- whitespace
# don't enable:
# - godox
# - maligned,prealloc
# - gochecknoglobals
@ -98,6 +101,6 @@ issues:
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.17.x # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.19.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"

View File

@ -917,6 +917,9 @@ linters-settings:
disabled-checks:
- wrapperFunc
- dupImport # https://github.com/go-critic/go-critic/issues/845
funlen:
lines: 100
statements: 50
linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
@ -925,11 +928,10 @@ linters:
- bodyclose
- deadcode
- depguard
# - dogsled - TODO: enable it when golangci.com will support it.
- dogsled
- dupl
- errcheck
# - funlen - TODO: enable it when golangci.com will support it.
# - godox - TODO: enable it when golangci.com will support it.
- funlen
- gochecknoinits
- goconst
- gocritic
@ -954,9 +956,10 @@ linters:
- unparam
- unused
- varcheck
# - whitespace - TODO: enable it when golangci.com will support it.
- whitespace
# don't enable:
# - godox
# - maligned,prealloc
# - gochecknoglobals
@ -974,7 +977,7 @@ issues:
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.17.x # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.19.x # use the fixed version to not introduce new linters unexpectedly
prepare:
- echo "here I can run custom commands, but no preparation needed for this repo"
```

View File

@ -21,7 +21,6 @@ func (Dogsled) Desc() string {
}
func (d Dogsled) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) {
var res []result.Issue
for _, f := range lintCtx.ASTCache.GetAllValidFiles() {
v := returnsVisitor{