Skip to content

Commit

Permalink
Change config
Browse files Browse the repository at this point in the history
  • Loading branch information
toshi0607 committed Jun 25, 2023
1 parent fc952b9 commit 437634f
Showing 1 changed file with 125 additions and 125 deletions.
250 changes: 125 additions & 125 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
# https://github.com/golangci/golangci-lint/blob/master/.golangci.yml
linters-settings:
depguard:
# old configuration. TODO(ldez): must be removed
list-type: denylist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
# new configuration
rules:
logger:
deny:
# logging is allowed only by logutils.Log,
# logrus is allowed to use only in logutils package.
- pkg: "github.com/sirupsen/logrus"
desc: logging is allowed only by logutils.Log
dupl:
threshold: 100
funlen:
lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner.
statements: 50
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
gocyclo:
min-complexity: 15
gofmt:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
goimports:
local-prefixes: github.com/golangci/golangci-lint
gomnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
ignored-numbers:
- '0'
- '1'
- '2'
- '3'
ignored-functions:
- strings.SplitN

govet:
check-shadowing: true
settings:
printf:
funcs:
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
revive:
rules:
- name: unexported-return
disabled: true
- name: unused-parameter
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
- name: exported
severity: warning
disabled: false
arguments:
- "checkPrivateReceivers"
- "sayRepetitiveInsteadOfStutters"
# https://golangci-lint.run/usage/linters/#stylecheck
stylecheck:
checks: ["-ST1000"]
#linters-settings:
# depguard:
# # old configuration. TODO(ldez): must be removed
# list-type: denylist
# packages:
# # logging is allowed only by logutils.Log, logrus
# # is allowed to use only in logutils package
# - github.com/sirupsen/logrus
# packages-with-error-message:
# - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
# # new configuration
# rules:
# logger:
# deny:
# # logging is allowed only by logutils.Log,
# # logrus is allowed to use only in logutils package.
# - pkg: "github.com/sirupsen/logrus"
# desc: logging is allowed only by logutils.Log
# dupl:
# threshold: 100
# funlen:
# lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner.
# statements: 50
# goconst:
# min-len: 2
# min-occurrences: 3
# gocritic:
# enabled-tags:
# - diagnostic
# - experimental
# - opinionated
# - performance
# - style
# disabled-checks:
# - dupImport # https://github.com/go-critic/go-critic/issues/845
# - ifElseChain
# - octalLiteral
# - whyNoLint
# gocyclo:
# min-complexity: 15
# gofmt:
# rewrite-rules:
# - pattern: 'interface{}'
# replacement: 'any'
# goimports:
# local-prefixes: github.com/golangci/golangci-lint
# gomnd:
# # don't include the "operation" and "assign"
# checks:
# - argument
# - case
# - condition
# - return
# ignored-numbers:
# - '0'
# - '1'
# - '2'
# - '3'
# ignored-functions:
# - strings.SplitN
#
# govet:
# check-shadowing: true
# settings:
# printf:
# funcs:
# - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
# - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
# - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
# - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
# lll:
# line-length: 140
# misspell:
# locale: US
# nolintlint:
# allow-unused: false # report any unused nolint directives
# require-explanation: false # don't require an explanation for nolint directives
# require-specific: false # don't require nolint directives to be specific about which linter is being skipped
# revive:
# rules:
# - name: unexported-return
# disabled: true
# - name: unused-parameter
# # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
# - name: exported
# severity: warning
# disabled: false
# arguments:
# - "checkPrivateReceivers"
# - "sayRepetitiveInsteadOfStutters"
# # https://golangci-lint.run/usage/linters/#stylecheck
# stylecheck:
# checks: ["-ST1000"]

linters:
disable-all: true
Expand Down Expand Up @@ -144,35 +144,35 @@ linters:
# - testpackage
# - wsl

issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gomnd

- path: pkg/golinters/errcheck.go
text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
- path: pkg/commands/run.go
text: "SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead"
- path: pkg/commands/run.go
text: "SA1019: e.cfg.Run.Deadline is deprecated: Deadline exists for historical compatibility and should not be used."

- path: pkg/golinters/gofumpt.go
text: "SA1019: settings.LangVersion is deprecated: use the global `run.go` instead."
- path: pkg/golinters/staticcheck_common.go
text: "SA1019: settings.GoVersion is deprecated: use the global `run.go` instead."
- path: pkg/lint/lintersdb/manager.go
text: "SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead."
- path: pkg/golinters/unused.go
text: "rangeValCopy: each iteration copies 160 bytes \\(consider pointers or indexing\\)"
# to enable revive
exclude-use-default: false

run:
timeout: 5m
skip-dirs:
- test/testdata_etc # test files
- internal/cache # extracted from Go code
- internal/renameio # extracted from Go code
- internal/robustio # extracted from Go code
#issues:
# # Excluding configuration per-path, per-linter, per-text and per-source
# exclude-rules:
# - path: _test\.go
# linters:
# - gomnd
#
# - path: pkg/golinters/errcheck.go
# text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead"
# - path: pkg/commands/run.go
# text: "SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead"
# - path: pkg/commands/run.go
# text: "SA1019: e.cfg.Run.Deadline is deprecated: Deadline exists for historical compatibility and should not be used."
#
# - path: pkg/golinters/gofumpt.go
# text: "SA1019: settings.LangVersion is deprecated: use the global `run.go` instead."
# - path: pkg/golinters/staticcheck_common.go
# text: "SA1019: settings.GoVersion is deprecated: use the global `run.go` instead."
# - path: pkg/lint/lintersdb/manager.go
# text: "SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead."
# - path: pkg/golinters/unused.go
# text: "rangeValCopy: each iteration copies 160 bytes \\(consider pointers or indexing\\)"
# # to enable revive
# exclude-use-default: false
#
#run:
# timeout: 5m
# skip-dirs:
# - test/testdata_etc # test files
# - internal/cache # extracted from Go code
# - internal/renameio # extracted from Go code
# - internal/robustio # extracted from Go code

0 comments on commit 437634f

Please sign in to comment.