mirror of
https://github.com/go-kratos/kratos.git
synced 2026-05-22 10:15:24 +02:00
ci: improve golangci static check (#1387)
* ci: improve golangci static check
This commit is contained in:
@@ -2,9 +2,11 @@ name: Go
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -65,8 +67,7 @@ jobs:
|
||||
- name: Lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
version: v1.41
|
||||
args: --disable-all
|
||||
version: v1.42
|
||||
skip-go-installation: true
|
||||
skip-pkg-cache: true
|
||||
only-new-issues: true
|
||||
|
||||
+46
-5
@@ -1,14 +1,55 @@
|
||||
run:
|
||||
timeout: 5m
|
||||
modules-download-mode: readonly
|
||||
skip-files:
|
||||
- ".*_test\\.go$"
|
||||
|
||||
linters:
|
||||
disable-all: true
|
||||
fast: false
|
||||
enable:
|
||||
- revive
|
||||
- staticcheck
|
||||
- bodyclose
|
||||
- deadcode
|
||||
- dogsled
|
||||
- durationcheck
|
||||
- errcheck
|
||||
- exportloopref
|
||||
- govet
|
||||
- gosimple
|
||||
- gofmt
|
||||
- errcheck
|
||||
- gofumpt
|
||||
- goconst
|
||||
- goimports
|
||||
- gomnd
|
||||
- ineffassign
|
||||
- lll
|
||||
- prealloc
|
||||
- revive
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- unconvert
|
||||
- varcheck
|
||||
- whitespace
|
||||
- wastedassign
|
||||
|
||||
# don't enable:
|
||||
# - asciicheck
|
||||
# - scopelint
|
||||
# - gochecknoglobals
|
||||
# - gocognit
|
||||
# - godot
|
||||
# - godox
|
||||
# - goerr113
|
||||
# - interfacer
|
||||
# - maligned
|
||||
# - nestif
|
||||
# - prealloc
|
||||
# - testpackage
|
||||
# - stylrcheck
|
||||
# - wsl
|
||||
|
||||
linters-settings:
|
||||
govet:
|
||||
check-shadowing: true
|
||||
whitespace:
|
||||
multi-func: true
|
||||
|
||||
Reference in New Issue
Block a user