Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .golangci.v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
run:
timeout: 5m

# The list of linter based on the v1.64.5
# See the full list https://golangci-lint.run/usage/linters/
linters:
disable-all: true
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- cyclop
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errchkjson
- errname
- errorlint
- exptostd
- forbidigo
- forcetypeassert
- funlen
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- goprintffuncname
- gosec
- grouper
- iface
- importas
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnesserr
- nilnil
- nlreturn
- noctx
- nolintlint
- perfsprint
- prealloc
- predeclared
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- sloglint
- sqlclosecheck
- stylecheck
- tagliatelle
- testifylint
- unconvert
- unparam
- usestdlibvars
- usetesting
- wastedassign
- whitespace

linters-settings:
goimports:
local-prefixes: github.com/example/repo
dupl:
threshold: 150
funlen:
lines: 120
statements: 60
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gocyclo:
min-complexity: 20
cyclop:
max-complexity: 20
skip-tests: true
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-unused: false
require-explanation: false
require-specific: false
nestif:
min-complexity: 4

issues:
#new-from-rev: HEAD
exclude-dirs:
- tilt_modules
- vendor
exclude-rules:
- path: _test\.go
linters:
- dupl
- mnd
- funlen
- gocyclo
- lll
- err113
- maintidx
- ireturn
- path: main\.go
linters:
- funlen
- forbidigo
- cyclop
154 changes: 83 additions & 71 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
run:
timeout: 5m

# The list of linter based on the v1.64.5
# See the full list https://golangci-lint.run/usage/linters/
version: "2"
issues:
#new-from-rev: HEAD
linters:
disable-all: true
default: none
# The list of linter based on the v2.1.6
# See the full list https://golangci-lint.run/usage/linters/
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- asasalint
- asciicheck
- bidichk
Expand All @@ -24,6 +18,7 @@ linters:
- dupword
- durationcheck
- err113
- errcheck
- errchkjson
- errname
- errorlint
Expand All @@ -36,13 +31,13 @@ linters:
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- goprintffuncname
- gosec
- govet
- grouper
- iface
- importas
- ineffassign
- ireturn
- lll
- loggercheck
Expand Down Expand Up @@ -70,68 +65,85 @@ linters:
- rowserrcheck
- sloglint
- sqlclosecheck
- stylecheck
- staticcheck
- tagliatelle
- testifylint
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- wastedassign
- whitespace

linters-settings:
goimports:
local-prefixes: github.com/example/repo
dupl:
threshold: 150
funlen:
lines: 120
statements: 60
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gocyclo:
min-complexity: 20
cyclop:
max-complexity: 20
skip-tests: true
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-unused: false
require-explanation: false
require-specific: false
nestif:
min-complexity: 4

issues:
#new-from-rev: HEAD
exclude-dirs:
- tilt_modules
- vendor
exclude-rules:
- path: _test\.go
linters:
- dupl
- mnd
- funlen
- gocyclo
- lll
- err113
- maintidx
- ireturn
- path: main\.go
linters:
- funlen
- forbidigo
- cyclop
settings:
cyclop:
max-complexity: 20
dupl:
threshold: 150
funlen:
lines: 120
statements: 60
goconst:
min-len: 2
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gocyclo:
min-complexity: 20
lll:
line-length: 140
misspell:
locale: US
nestif:
min-complexity: 4
nolintlint:
require-explanation: false
require-specific: false
allow-unused: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- dupl
- err113
- funlen
- gocyclo
- ireturn
- lll
- maintidx
- mnd
path: _test\.go
- linters:
- cyclop
- forbidigo
- funlen
path: main\.go
- linters:
- cyclop
path: (.+)_test\.go
paths:
- tilt_modules
- vendor
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/example/repo
exclusions:
generated: lax
paths:
- tilt_modules
- vendor