ci: improve golangci static check (#1387)

* ci: improve golangci static check
pull/1394/head
Kagaya 3 years ago committed by GitHub
parent e3d55b74bd
commit c55528f321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      .github/workflows/go.yml
  2. 51
      .golangci.yml

@ -2,9 +2,11 @@ name: Go
on: on:
push: push:
branches: [ main ] branches:
- main
pull_request: pull_request:
branches: [ main ] branches:
- main
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -65,8 +67,7 @@ jobs:
- name: Lint - name: Lint
uses: golangci/golangci-lint-action@v2 uses: golangci/golangci-lint-action@v2
with: with:
version: v1.41 version: v1.42
args: --disable-all
skip-go-installation: true skip-go-installation: true
skip-pkg-cache: true skip-pkg-cache: true
only-new-issues: true only-new-issues: true

@ -1,14 +1,55 @@
run: run:
timeout: 5m timeout: 5m
modules-download-mode: readonly modules-download-mode: readonly
skip-files:
- ".*_test\\.go$"
linters: linters:
disable-all: true
fast: false
enable: enable:
- revive - bodyclose
- staticcheck - deadcode
- dogsled
- durationcheck
- errcheck
- exportloopref
- govet - govet
- gosimple - gosimple
- gofmt - 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

Loading…
Cancel
Save