mirror of https://github.com/jetkvm/kvm.git
build: add cyclop, contextcheck, gosec and promlinter
This commit is contained in:
parent
bcc307b147
commit
82c5e6b38f
|
@ -0,0 +1,6 @@
|
||||||
|
# This has to be >= v1.57.0 for module plugin system support.
|
||||||
|
version: v2.4.0
|
||||||
|
plugins:
|
||||||
|
- module: "go.uber.org/nilaway"
|
||||||
|
import: "go.uber.org/nilaway/cmd/gclplugin"
|
||||||
|
version: latest # Or a fixed version for reproducible builds.
|
|
@ -1,10 +1,18 @@
|
||||||
version: "2"
|
version: '2'
|
||||||
linters:
|
linters:
|
||||||
enable:
|
enable:
|
||||||
- forbidigo
|
- forbidigo
|
||||||
- misspell
|
- misspell
|
||||||
- whitespace
|
- whitespace
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
|
# Static analysis tool to detect potential nil panics in Go code.
|
||||||
|
- nilaway
|
||||||
|
# Checks function and package cyclomatic complexity.
|
||||||
|
- cyclop
|
||||||
|
# Check whether the function uses a non-inherited context.
|
||||||
|
- contextcheck
|
||||||
|
- gosec
|
||||||
|
- promlinter
|
||||||
settings:
|
settings:
|
||||||
forbidigo:
|
forbidigo:
|
||||||
forbid:
|
forbid:
|
||||||
|
@ -12,6 +20,12 @@ linters:
|
||||||
msg: Do not commit print statements. Use logger package.
|
msg: Do not commit print statements. Use logger package.
|
||||||
- pattern: ^log\.(Fatal|Panic|Print)(f|ln)?.*$
|
- pattern: ^log\.(Fatal|Panic|Print)(f|ln)?.*$
|
||||||
msg: Do not commit log statements. Use logger package.
|
msg: Do not commit log statements. Use logger package.
|
||||||
|
custom:
|
||||||
|
nilaway:
|
||||||
|
type: module
|
||||||
|
description: 'Static analysis tool to detect potential nil panics in Go code.'
|
||||||
|
settings:
|
||||||
|
exclude-pkgs: vendor
|
||||||
exclusions:
|
exclusions:
|
||||||
generated: lax
|
generated: lax
|
||||||
presets:
|
presets:
|
||||||
|
@ -33,6 +47,22 @@ linters:
|
||||||
- third_party$
|
- third_party$
|
||||||
- builtin$
|
- builtin$
|
||||||
- examples$
|
- examples$
|
||||||
|
severity:
|
||||||
|
default: error
|
||||||
|
rules:
|
||||||
|
- linters:
|
||||||
|
- cyclop
|
||||||
|
severity: warning
|
||||||
|
- linters:
|
||||||
|
- contextcheck
|
||||||
|
severity: warning
|
||||||
|
- linters:
|
||||||
|
- gosec
|
||||||
|
severity: warning
|
||||||
|
- linters:
|
||||||
|
- gosec
|
||||||
|
severity: warning
|
||||||
|
|
||||||
formatters:
|
formatters:
|
||||||
enable:
|
enable:
|
||||||
- goimports
|
- goimports
|
||||||
|
|
Loading…
Reference in New Issue