mirror of
https://github.com/appleboy/drone-telegram.git
synced 2026-06-04 18:23:45 +08:00
chore: migrate golangci-lint config to v2
- Add version field and migrate to v2 config format - Replace deprecated linters with modern equivalents - Add new linters: bidichk, depguard, forbidigo, revive, testifylint, etc. - Move gofmt, gofumpt, golines to formatters section - Configure revive rules, depguard deny list, and exclusion presets
This commit is contained in:
+100
-23
@@ -1,37 +1,114 @@
|
|||||||
|
version: "2"
|
||||||
|
output:
|
||||||
|
sort-order:
|
||||||
|
- file
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
default: none
|
||||||
enable:
|
enable:
|
||||||
|
- bidichk
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- dogsled
|
- depguard
|
||||||
- errcheck
|
- errcheck
|
||||||
- exportloopref
|
- forbidigo
|
||||||
- exhaustive
|
- gocheckcompilerdirectives
|
||||||
- gochecknoinits
|
|
||||||
- goconst
|
|
||||||
- gocritic
|
- gocritic
|
||||||
- gofmt
|
|
||||||
- goimports
|
|
||||||
- goprintffuncname
|
|
||||||
- gosec
|
|
||||||
- gosimple
|
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- misspell
|
- mirror
|
||||||
|
- modernize
|
||||||
- nakedret
|
- nakedret
|
||||||
- noctx
|
- nilnil
|
||||||
- nolintlint
|
- nolintlint
|
||||||
|
- perfsprint
|
||||||
|
- revive
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- stylecheck
|
- testifylint
|
||||||
- typecheck
|
|
||||||
- unconvert
|
- unconvert
|
||||||
- unparam
|
- unparam
|
||||||
- unused
|
- unused
|
||||||
- whitespace
|
- usestdlibvars
|
||||||
- gofumpt
|
- usetesting
|
||||||
|
- wastedassign
|
||||||
issues:
|
settings:
|
||||||
exclude-rules:
|
depguard:
|
||||||
# Exclude `lll` issues for long lines with `go:generate`.
|
rules:
|
||||||
|
main:
|
||||||
|
deny:
|
||||||
|
- pkg: io/ioutil
|
||||||
|
desc: use os or io instead
|
||||||
|
- pkg: golang.org/x/exp
|
||||||
|
desc: it's experimental and unreliable
|
||||||
|
- pkg: github.com/pkg/errors
|
||||||
|
desc: use builtin errors package instead
|
||||||
|
nolintlint:
|
||||||
|
allow-unused: false
|
||||||
|
require-explanation: true
|
||||||
|
require-specific: true
|
||||||
|
gocritic:
|
||||||
|
enabled-checks:
|
||||||
|
- equalFold
|
||||||
|
disabled-checks: []
|
||||||
|
revive:
|
||||||
|
severity: error
|
||||||
|
rules:
|
||||||
|
- name: blank-imports
|
||||||
|
- name: constant-logical-expr
|
||||||
|
- name: context-as-argument
|
||||||
|
- name: context-keys-type
|
||||||
|
- name: dot-imports
|
||||||
|
- name: empty-lines
|
||||||
|
- name: error-return
|
||||||
|
- name: error-strings
|
||||||
|
- name: exported
|
||||||
|
- name: identical-branches
|
||||||
|
- name: if-return
|
||||||
|
- name: increment-decrement
|
||||||
|
- name: modifies-value-receiver
|
||||||
|
- name: package-comments
|
||||||
|
- name: redefines-builtin-id
|
||||||
|
- name: superfluous-else
|
||||||
|
- name: time-naming
|
||||||
|
- name: unexported-return
|
||||||
|
- name: var-declaration
|
||||||
|
- name: var-naming
|
||||||
|
disabled: true
|
||||||
|
staticcheck:
|
||||||
|
checks:
|
||||||
|
- all
|
||||||
|
testifylint: {}
|
||||||
|
usetesting:
|
||||||
|
os-temp-dir: true
|
||||||
|
perfsprint:
|
||||||
|
concat-loop: false
|
||||||
|
govet:
|
||||||
|
enable:
|
||||||
|
- nilness
|
||||||
|
- unusedwrite
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
presets:
|
||||||
|
- comments
|
||||||
|
- common-false-positives
|
||||||
|
- legacy
|
||||||
|
- std-error-handling
|
||||||
|
rules:
|
||||||
- linters:
|
- linters:
|
||||||
- lll
|
- errcheck
|
||||||
source: "^//go:generate "
|
- staticcheck
|
||||||
|
- unparam
|
||||||
|
path: _test\.go
|
||||||
|
issues:
|
||||||
|
max-issues-per-linter: 0
|
||||||
|
max-same-issues: 0
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gofmt
|
||||||
|
- gofumpt
|
||||||
|
- golines
|
||||||
|
settings:
|
||||||
|
gofumpt:
|
||||||
|
extra-rules: true
|
||||||
|
exclusions:
|
||||||
|
generated: lax
|
||||||
|
run:
|
||||||
|
timeout: 10m
|
||||||
|
|||||||
Reference in New Issue
Block a user