86 lines
1.8 KiB
YAML
86 lines
1.8 KiB
YAML
|
# Code generated by gen-lint. DO NOT EDIT.
|
||
|
|
||
|
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
|
||
|
- 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:
|
||
|
enable:
|
||
|
- shadow
|
||
|
goimports:
|
||
|
local-prefixes: git.ifooth.com/common/pkg
|
||
|
gci:
|
||
|
sections:
|
||
|
- standard
|
||
|
- default
|
||
|
- prefix(git.ifooth.com/common/pkg)
|
||
|
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: line-length-limit
|
||
|
arguments:
|
||
|
- 160
|
||
|
- name: function-length
|
||
|
arguments:
|
||
|
- 80 # statements
|
||
|
- 120 # lines
|
||
|
- name: cyclomatic
|
||
|
arguments:
|
||
|
- 30
|
||
|
- name: use-any
|
||
|
- name: early-return
|
||
|
- name: exported
|
||
|
arguments:
|
||
|
- checkPrivateReceivers
|
||
|
- sayRepetitiveInsteadOfStutters
|
||
|
- name: package-comments
|