mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 07:45:18 +00:00
chore(linter): enable gosec on golangci linter and reformat config file (#1983)
add in gosec to the golangci.yml config file and reorder the linters-settings to be in alphabetical order
This commit is contained in:
parent
774e2efce8
commit
3c4d91a443
@ -14,71 +14,71 @@ linters:
|
|||||||
- contextcheck
|
- contextcheck
|
||||||
- decorder
|
- decorder
|
||||||
- dogsled
|
- dogsled
|
||||||
# - dupl
|
# - dupl
|
||||||
# - dupword
|
# - dupword
|
||||||
- durationcheck
|
- durationcheck
|
||||||
- errcheck
|
- errcheck
|
||||||
- errchkjson
|
- errchkjson
|
||||||
- errname
|
- errname
|
||||||
- errorlint
|
- errorlint
|
||||||
# - exhaustive
|
# - exhaustive
|
||||||
- exportloopref
|
- exportloopref
|
||||||
- funlen
|
- funlen
|
||||||
- gci
|
- gci
|
||||||
- ginkgolinter
|
- ginkgolinter
|
||||||
- gocheckcompilerdirectives
|
- gocheckcompilerdirectives
|
||||||
# - gochecknoglobals
|
# - gochecknoglobals
|
||||||
# - gochecknoinits
|
# - gochecknoinits
|
||||||
- goconst
|
- goconst
|
||||||
- gocritic
|
- gocritic
|
||||||
- godox
|
- godox
|
||||||
- gofmt
|
- gofmt
|
||||||
# - gofumpt
|
# - gofumpt
|
||||||
- goheader
|
- goheader
|
||||||
- goimports
|
- goimports
|
||||||
- mnd
|
- mnd
|
||||||
# - gomodguard
|
# - gomodguard
|
||||||
- goprintffuncname
|
- goprintffuncname
|
||||||
# - gosec
|
- gosec
|
||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- grouper
|
- grouper
|
||||||
- importas
|
- importas
|
||||||
- ineffassign
|
- ineffassign
|
||||||
# - interfacebloat
|
# - interfacebloat
|
||||||
- lll
|
- lll
|
||||||
- loggercheck
|
- loggercheck
|
||||||
- makezero
|
- makezero
|
||||||
- mirror
|
- mirror
|
||||||
- misspell
|
- misspell
|
||||||
- musttag
|
- musttag
|
||||||
# - nakedret
|
# - nakedret
|
||||||
# - nestif
|
# - nestif
|
||||||
- nilerr
|
- nilerr
|
||||||
# - nilnil
|
# - nilnil
|
||||||
# - noctx
|
# - noctx
|
||||||
- nolintlint
|
- nolintlint
|
||||||
# - nonamedreturns
|
# - nonamedreturns
|
||||||
- nosprintfhostport
|
- nosprintfhostport
|
||||||
- prealloc
|
- prealloc
|
||||||
- predeclared
|
- predeclared
|
||||||
- promlinter
|
- promlinter
|
||||||
# - reassign
|
# - reassign
|
||||||
- revive
|
- revive
|
||||||
- rowserrcheck
|
- rowserrcheck
|
||||||
- staticcheck
|
- staticcheck
|
||||||
# - stylecheck
|
# - stylecheck
|
||||||
- tagalign
|
- tagalign
|
||||||
# - testpackage
|
# - testpackage
|
||||||
# - thelper
|
# - thelper
|
||||||
# - tparallel
|
# - tparallel
|
||||||
- typecheck
|
- typecheck
|
||||||
# - unconvert
|
# - unconvert
|
||||||
- unparam
|
- unparam
|
||||||
- unused
|
- unused
|
||||||
# - usestdlibvars
|
# - usestdlibvars
|
||||||
- wastedassign
|
- wastedassign
|
||||||
# - whitespace
|
# - whitespace
|
||||||
- wrapcheck
|
- wrapcheck
|
||||||
|
|
||||||
|
|
||||||
@ -104,18 +104,20 @@ linters-settings:
|
|||||||
- BUG
|
- BUG
|
||||||
- FIXME
|
- FIXME
|
||||||
- HACK
|
- HACK
|
||||||
|
gosec:
|
||||||
|
exclude-generated: true
|
||||||
lll:
|
lll:
|
||||||
line-length: 120
|
line-length: 120
|
||||||
|
misspell:
|
||||||
|
locale: US
|
||||||
|
ignore-words: expect
|
||||||
nolintlint:
|
nolintlint:
|
||||||
allow-leading-space: false
|
allow-leading-space: false
|
||||||
require-explanation: true
|
require-explanation: true
|
||||||
require-specific: true
|
require-specific: true
|
||||||
unparam:
|
|
||||||
check-exported: true # checks exported functions and methods for unused params
|
|
||||||
misspell:
|
|
||||||
locale: US
|
|
||||||
ignore-words: expect
|
|
||||||
prealloc:
|
prealloc:
|
||||||
simple: true # enables simple preallocation checks
|
simple: true # enables simple preallocation checks
|
||||||
range-loops: true # enabled preallocation checks in range loops
|
range-loops: true # enabled preallocation checks in range loops
|
||||||
for-loops: false # disables preallocation checks in for loops
|
for-loops: false # disables preallocation checks in for loops
|
||||||
|
unparam:
|
||||||
|
check-exported: true # checks exported functions and methods for unused params
|
||||||
|
Loading…
Reference in New Issue
Block a user