chore: update linter
This commit is contained in:
parent
38dd4b1898
commit
00ebf584ff
2
.github/workflows/go-cross.yml
vendored
2
.github/workflows/go-cross.yml
vendored
@ -3,11 +3,9 @@ name: Go Matrix
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -3,11 +3,9 @@ name: Main
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -17,7 +15,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
GO_VERSION: stable
|
GO_VERSION: stable
|
||||||
GOLANGCI_LINT_VERSION: v1.64.6
|
GOLANGCI_LINT_VERSION: v2.0.1
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -36,7 +34,7 @@ jobs:
|
|||||||
# https://golangci-lint.run/usage/install#other-ci
|
# https://golangci-lint.run/usage/install#other-ci
|
||||||
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }}
|
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }}
|
||||||
run: |
|
run: |
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
|
||||||
golangci-lint --version
|
golangci-lint --version
|
||||||
|
|
||||||
- name: Make
|
- name: Make
|
||||||
|
|||||||
188
.golangci.yml
188
.golangci.yml
@ -1,108 +1,108 @@
|
|||||||
|
version: "2"
|
||||||
|
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gci
|
||||||
|
- gofumpt
|
||||||
|
settings:
|
||||||
|
gofumpt:
|
||||||
|
extra-rules: true
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
default: all
|
||||||
disable:
|
disable:
|
||||||
- tenv # deprecated
|
|
||||||
- sqlclosecheck # not relevant (SQL)
|
|
||||||
- rowserrcheck # not relevant (SQL)
|
|
||||||
- cyclop # duplicate of gocyclo
|
- cyclop # duplicate of gocyclo
|
||||||
- lll
|
|
||||||
- dupl
|
- dupl
|
||||||
- prealloc
|
|
||||||
- wsl
|
|
||||||
- nlreturn
|
|
||||||
- mnd
|
|
||||||
- testpackage
|
|
||||||
- paralleltest
|
|
||||||
- tparallel
|
|
||||||
- err113
|
- err113
|
||||||
- wrapcheck
|
|
||||||
- exhaustive
|
- exhaustive
|
||||||
- exhaustruct
|
- exhaustruct
|
||||||
- varnamelen
|
- lll
|
||||||
|
- mnd
|
||||||
- nilnil
|
- nilnil
|
||||||
|
- nlreturn
|
||||||
|
- paralleltest
|
||||||
|
- prealloc
|
||||||
|
- rowserrcheck # not relevant (SQL)
|
||||||
|
- sqlclosecheck # not relevant (SQL)
|
||||||
|
- testpackage
|
||||||
|
- tparallel
|
||||||
|
- varnamelen
|
||||||
|
- wrapcheck
|
||||||
|
- wsl
|
||||||
|
settings:
|
||||||
|
depguard:
|
||||||
|
rules:
|
||||||
|
main:
|
||||||
|
deny:
|
||||||
|
- pkg: github.com/instana/testify
|
||||||
|
desc: not allowed
|
||||||
|
- pkg: github.com/pkg/errors
|
||||||
|
desc: Should be replaced by standard lib errors package
|
||||||
|
forbidigo:
|
||||||
|
forbid:
|
||||||
|
- pattern: ^print(ln)?$
|
||||||
|
- pattern: ^spew\.Print(f|ln)?$
|
||||||
|
- pattern: ^spew\.Dump$
|
||||||
|
funlen:
|
||||||
|
lines: -1
|
||||||
|
statements: 40
|
||||||
|
goconst:
|
||||||
|
min-len: 3
|
||||||
|
min-occurrences: 3
|
||||||
|
gocritic:
|
||||||
|
disabled-checks:
|
||||||
|
- sloppyReassign
|
||||||
|
- rangeValCopy
|
||||||
|
- octalLiteral
|
||||||
|
- paramTypeCombine # already handle by gofumpt.extra-rules
|
||||||
|
enabled-tags:
|
||||||
|
- diagnostic
|
||||||
|
- style
|
||||||
|
- performance
|
||||||
|
settings:
|
||||||
|
hugeParam:
|
||||||
|
sizeThreshold: 100
|
||||||
|
gocyclo:
|
||||||
|
min-complexity: 12
|
||||||
|
godox:
|
||||||
|
keywords:
|
||||||
|
- FIXME
|
||||||
|
gomoddirectives:
|
||||||
|
replace-allow-list:
|
||||||
|
- github.com/abbot/go-http-auth
|
||||||
|
- github.com/go-check/check
|
||||||
|
- github.com/gorilla/mux
|
||||||
|
- github.com/mailgun/minheap
|
||||||
|
- github.com/mailgun/multibuf
|
||||||
|
- github.com/jaguilar/vt100
|
||||||
|
gosec:
|
||||||
|
excludes:
|
||||||
|
- G204 # Subprocess launched with a potential tainted input or cmd arguments
|
||||||
|
- G301 # Expect directory permissions to be 0750 or less
|
||||||
|
- G306 # Expect WriteFile permissions to be 0600 or less
|
||||||
|
govet:
|
||||||
|
disable:
|
||||||
|
- fieldalignment
|
||||||
|
enable-all: true
|
||||||
|
misspell:
|
||||||
|
locale: US
|
||||||
|
|
||||||
linters-settings:
|
exclusions:
|
||||||
govet:
|
presets:
|
||||||
enable-all: true
|
- comments
|
||||||
disable:
|
|
||||||
- fieldalignment
|
|
||||||
gocyclo:
|
|
||||||
min-complexity: 12
|
|
||||||
goconst:
|
|
||||||
min-len: 3
|
|
||||||
min-occurrences: 3
|
|
||||||
misspell:
|
|
||||||
locale: US
|
|
||||||
gofumpt:
|
|
||||||
extra-rules: true
|
|
||||||
depguard:
|
|
||||||
rules:
|
rules:
|
||||||
main:
|
- linters:
|
||||||
deny:
|
- gochecknoglobals
|
||||||
- pkg: "github.com/instana/testify"
|
- gochecknoinits
|
||||||
desc: not allowed
|
path: cmd/
|
||||||
- pkg: "github.com/pkg/errors"
|
- linters:
|
||||||
desc: Should be replaced by standard lib errors package
|
- tagalign
|
||||||
funlen:
|
path: internal/traefikv[1-3]/
|
||||||
lines: -1
|
- path: (.+)\.go$
|
||||||
statements: 40
|
text: 'ST1000: at least one file in a package should have a package comment'
|
||||||
godox:
|
- path: (.+)\.go$
|
||||||
keywords:
|
text: 'package-comments: should have a package comment'
|
||||||
- FIXME
|
|
||||||
gocritic:
|
|
||||||
enabled-tags:
|
|
||||||
- diagnostic
|
|
||||||
- style
|
|
||||||
- performance
|
|
||||||
disabled-checks:
|
|
||||||
- sloppyReassign
|
|
||||||
- rangeValCopy
|
|
||||||
- octalLiteral
|
|
||||||
- paramTypeCombine # already handle by gofumpt.extra-rules
|
|
||||||
settings:
|
|
||||||
hugeParam:
|
|
||||||
sizeThreshold: 100
|
|
||||||
forbidigo:
|
|
||||||
forbid:
|
|
||||||
- '^print(ln)?$'
|
|
||||||
- '^spew\.Print(f|ln)?$'
|
|
||||||
- '^spew\.Dump$'
|
|
||||||
gomoddirectives:
|
|
||||||
replace-allow-list:
|
|
||||||
- github.com/abbot/go-http-auth
|
|
||||||
- github.com/go-check/check
|
|
||||||
- github.com/gorilla/mux
|
|
||||||
- github.com/mailgun/minheap
|
|
||||||
- github.com/mailgun/multibuf
|
|
||||||
- github.com/jaguilar/vt100
|
|
||||||
gosec:
|
|
||||||
excludes:
|
|
||||||
- G204 # Subprocess launched with a potential tainted input or cmd arguments
|
|
||||||
- G301 # Expect directory permissions to be 0750 or less
|
|
||||||
- G306 # Expect WriteFile permissions to be 0600 or less
|
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
exclude-use-default: false
|
|
||||||
max-issues-per-linter: 0
|
max-issues-per-linter: 0
|
||||||
max-same-issues: 0
|
max-same-issues: 0
|
||||||
exclude:
|
|
||||||
- 'ST1000: at least one file in a package should have a package comment'
|
|
||||||
- 'package-comments: should have a package comment'
|
|
||||||
exclude-rules:
|
|
||||||
- path: cmd/
|
|
||||||
linters:
|
|
||||||
- gochecknoglobals
|
|
||||||
- gochecknoinits
|
|
||||||
- path: internal/traefikv[1-3]/
|
|
||||||
linters:
|
|
||||||
- tagalign
|
|
||||||
|
|
||||||
output:
|
|
||||||
show-stats: true
|
|
||||||
sort-results: true
|
|
||||||
sort-order:
|
|
||||||
- linter
|
|
||||||
- file
|
|
||||||
|
|
||||||
run:
|
|
||||||
timeout: 5m
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user