mirror of
https://github.com/super-linter/super-linter.git
synced 2024-08-26 06:07:03 -04:00
fix: fix a shadowing setting in .golangci.yml (#5654)
This commit is contained in:
parent
56576d491d
commit
03b4aa0798
3 changed files with 11 additions and 43 deletions
41
.github/linters/.golangci.yml
vendored
41
.github/linters/.golangci.yml
vendored
|
@ -1,41 +0,0 @@
|
||||||
---
|
|
||||||
#########################
|
|
||||||
#########################
|
|
||||||
## Golang Linter rules ##
|
|
||||||
#########################
|
|
||||||
#########################
|
|
||||||
|
|
||||||
# configure golangci-lint
|
|
||||||
# https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
|
|
||||||
|
|
||||||
issues:
|
|
||||||
exclude-rules:
|
|
||||||
- path: _test\.go
|
|
||||||
linters:
|
|
||||||
- dupl
|
|
||||||
- gosec
|
|
||||||
- goconst
|
|
||||||
linters:
|
|
||||||
enable:
|
|
||||||
- gosec
|
|
||||||
- unconvert
|
|
||||||
- gocyclo
|
|
||||||
- goconst
|
|
||||||
- goimports
|
|
||||||
- gocritic
|
|
||||||
- govet
|
|
||||||
- revive
|
|
||||||
linters-settings:
|
|
||||||
errcheck:
|
|
||||||
# report about assignment of errors to blank identifier
|
|
||||||
# default is false: such cases aren't reported by default.
|
|
||||||
check-blank: true
|
|
||||||
govet:
|
|
||||||
# report about shadowed variables
|
|
||||||
check-shadowing: true
|
|
||||||
gocyclo:
|
|
||||||
# minimal code complexity to report, 30 by default
|
|
||||||
min-complexity: 15
|
|
||||||
maligned:
|
|
||||||
# print struct with more effective memory layout or not, false by default
|
|
||||||
suggest-new: true
|
|
|
@ -30,8 +30,9 @@ linters-settings:
|
||||||
# default is false: such cases aren't reported by default.
|
# default is false: such cases aren't reported by default.
|
||||||
check-blank: true
|
check-blank: true
|
||||||
govet:
|
govet:
|
||||||
|
enable:
|
||||||
# report about shadowed variables
|
# report about shadowed variables
|
||||||
check-shadowing: true
|
- shadowing
|
||||||
gocyclo:
|
gocyclo:
|
||||||
# minimal code complexity to report, 30 by default
|
# minimal code complexity to report, 30 by default
|
||||||
min-complexity: 15
|
min-complexity: 15
|
||||||
|
|
|
@ -8,3 +8,11 @@ import (
|
||||||
if len(in) == 0 {
|
if len(in) == 0 {
|
||||||
return "", fmt.Errorf("Input is empty")
|
return "", fmt.Errorf("Input is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x := 0
|
||||||
|
{
|
||||||
|
var x int
|
||||||
|
x++
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(x)
|
||||||
|
|
Loading…
Reference in a new issue