-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
run: | ||
timeout: 5m | ||
|
||
issues: | ||
# 显示所有 issue | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-use-default: false | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# enable by default | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
|
||
# custom | ||
# - gci | ||
- goconst | ||
- gocyclo | ||
- gofmt | ||
- goheader | ||
- goimports | ||
- gosec | ||
- misspell | ||
- nakedret | ||
- revive | ||
- unconvert | ||
- unparam | ||
|
||
linters-settings: | ||
# 只开启特定的规则 | ||
errcheck: | ||
exclude-functions: | ||
- (*os.File).Close | ||
- (io.Closer).Close | ||
- (net/http.ResponseWriter).Write | ||
- io.Copy | ||
- os.RemoveAll | ||
govet: | ||
check-shadowing: true | ||
gocyclo: | ||
min-complexity: 30 | ||
# goimports: | ||
# local-prefixes: github.com/ifooth/devcontainer | ||
# gci: | ||
# sections: | ||
# - standard | ||
# - default | ||
# - prefix(github.com/ifooth/devcontainer) | ||
gosec: | ||
includes: | ||
- G201 # SQL query construction using format string | ||
- G202 # SQL query construction using string concatenation | ||
- G101 # Look for hard coded credentials | ||
- G401 # Detect the usage of DES, RC4, MD5 or SHA1 | ||
- G402 # Look for bad TLS connection settings | ||
- G403 # Ensure minimum RSA key length of 2048 bits | ||
- G404 # Insecure random number source (rand) | ||
- G504 # Import blocklist: net/http/cgi | ||
misspell: | ||
locale: US | ||
|
||
revive: | ||
rules: | ||
- name: exported | ||
severity: warning | ||
disabled: false | ||
arguments: | ||
- checkPrivateReceivers | ||
- sayRepetitiveInsteadOfStutters |