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

View File

@ -917,6 +917,9 @@ linters-settings:
disabled-checks: disabled-checks:
- wrapperFunc - wrapperFunc
- dupImport # https://github.com/go-critic/go-critic/issues/845 - dupImport # https://github.com/go-critic/go-critic/issues/845
funlen:
lines: 100
statements: 50
linters: linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
@ -925,11 +928,10 @@ linters:
- bodyclose - bodyclose
- deadcode - deadcode
- depguard - depguard
# - dogsled - TODO: enable it when golangci.com will support it. - dogsled
- dupl - dupl
- errcheck - errcheck
# - funlen - TODO: enable it when golangci.com will support it. - funlen
# - godox - TODO: enable it when golangci.com will support it.
- gochecknoinits - gochecknoinits
- goconst - goconst
- gocritic - gocritic
@ -954,9 +956,10 @@ linters:
- unparam - unparam
- unused - unused
- varcheck - varcheck
# - whitespace - TODO: enable it when golangci.com will support it. - whitespace
# don't enable: # don't enable:
# - godox
# - maligned,prealloc # - maligned,prealloc
# - gochecknoglobals # - gochecknoglobals
@ -974,7 +977,7 @@ issues:
# golangci.com configuration # golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration # https://github.com/golangci/golangci/wiki/Configuration
service: 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: prepare:
- echo "here I can run custom commands, but no preparation needed for this repo" - 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) { func (d Dogsled) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) {
var res []result.Issue var res []result.Issue
for _, f := range lintCtx.ASTCache.GetAllValidFiles() { for _, f := range lintCtx.ASTCache.GetAllValidFiles() {
v := returnsVisitor{ v := returnsVisitor{