refactor(lint): update golangci-lint to v2 and configure .golangci.yml (#3956)
* refactor(lint): update golangci-lint to v2 and configure .golangci.yml Signed-off-by: yxxhero <aiopsclub@163.com> * build: Update golangci-lint action and config Signed-off-by: yxxhero <aiopsclub@163.com> --------- Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
parent
e2976c3a9e
commit
8d2d67255a
|
|
@ -21,10 +21,9 @@ jobs:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Golangci lint
|
- name: Golangci lint
|
||||||
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347
|
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd
|
||||||
with:
|
with:
|
||||||
version: v1.62
|
version: v2.0
|
||||||
args: --verbose --timeout=10m
|
|
||||||
|
|
||||||
- name: Markdown lint
|
- name: Markdown lint
|
||||||
uses: docker://avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee
|
uses: docker://avtodev/markdown-lint:v1@sha256:6aeedc2f49138ce7a1cd0adffc1b1c0321b841dc2102408967d9301c031949ee
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,57 @@
|
||||||
|
version: "2"
|
||||||
run:
|
run:
|
||||||
deadline: 3m
|
|
||||||
modules-download-mode: readonly
|
modules-download-mode: readonly
|
||||||
|
linters:
|
||||||
linters-settings:
|
default: none
|
||||||
|
enable:
|
||||||
|
- errcheck
|
||||||
|
- goconst
|
||||||
|
- gocyclo
|
||||||
|
- govet
|
||||||
|
- misspell
|
||||||
|
- staticcheck
|
||||||
|
settings:
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 100
|
min-complexity: 100
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
presets:
|
||||||
|
- comments
|
||||||
|
- common-false-positives
|
||||||
|
- legacy
|
||||||
|
- std-error-handling
|
||||||
|
rules:
|
||||||
|
- linters:
|
||||||
|
- staticcheck
|
||||||
|
text: 'SA1019:'
|
||||||
|
paths:
|
||||||
|
- third_party$
|
||||||
|
- builtin$
|
||||||
|
- examples$
|
||||||
|
issues:
|
||||||
|
new: true
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gci
|
||||||
|
- gofmt
|
||||||
|
settings:
|
||||||
gci:
|
gci:
|
||||||
sections:
|
sections:
|
||||||
- standard
|
- standard
|
||||||
- default
|
- default
|
||||||
- prefix(d7y.io/api)
|
- prefix(d7y.io/api)
|
||||||
- prefix(d7y.io/dragonfly/v2)
|
- prefix(d7y.io/dragonfly/v2)
|
||||||
|
exclusions:
|
||||||
issues:
|
generated: lax
|
||||||
new: true
|
paths:
|
||||||
exclude-rules:
|
- third_party$
|
||||||
- linters:
|
- builtin$
|
||||||
- staticcheck
|
- examples$
|
||||||
text: "SA1019:"
|
|
||||||
|
|
||||||
linters:
|
|
||||||
disable-all: true
|
|
||||||
enable:
|
|
||||||
- gci
|
|
||||||
- gofmt
|
|
||||||
- misspell
|
|
||||||
- govet
|
|
||||||
- goconst
|
|
||||||
- gocyclo
|
|
||||||
- staticcheck
|
|
||||||
- errcheck
|
|
||||||
|
|
||||||
output:
|
output:
|
||||||
format: colored-line-number
|
formats:
|
||||||
print-issued-lines: true
|
text:
|
||||||
|
path: stdout
|
||||||
print-linter-name: true
|
print-linter-name: true
|
||||||
|
print-issued-lines: true
|
||||||
|
colors: true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue