api-testing/tools/linter/golangci-lint/.golangci.yml

104 lines
2.5 KiB
YAML

run:
timeout: 10m
linters:
enable:
- bodyclose
- depguard
- errorlint
- exportloopref
- gofmt
- gofumpt
- goimports
- goheader
- gocritic
- gosec
- govet
- misspell
- revive
- stylecheck
- testifylint
- unconvert
- unparam
linters-settings:
depguard:
rules:
Main:
deny:
- pkg: github.com/gogo/protobuf
desc: "gogo/protobuf is deprecated, use golang/protobuf"
- pkg: gopkg.in/yaml.v2
desc: "use sigs.k8s.io/yaml instead"
- pkg: gopkg.in/yaml.v3
desc: "use sigs.k8s.io/yaml instead"
- pkg: k8s.io/utils/pointer
desc: "use k8s.io/utils/ptr instead"
- pkg: github.com/tetratelabs/multierror
desc: "use errors instead"
gci:
sections:
# Captures all standard packages if they do not match another section.
- standard
# Contains all imports that could not be matched to another section type.
- default
# Groups all imports with the specified Prefix.
- prefix(github.com/LinuxSuRen/api-testing)
gofmt:
simplify: true
goheader:
# Note that because the format is different (this needs no comment markers),
# updating this text means also updating /tools/boilerplate.txt so that
# `make generate` will update the generated files correctly.
template: |-
Copyright Envoy Gateway Authors
SPDX-License-Identifier: Apache-2.0
The full text of the Apache license is available in the LICENSE file at
the root of the repo.
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/LinuxSuRen/api-testing/
govet:
enable-all: true
disable:
- shadow
- fieldalignment
revive:
rules:
# TODO: enable if-return check
- name: if-return
disabled: true
testifylint:
disable:
- float-compare
- go-require
enable:
- bool-compare
- compares
- empty
- error-is-as
- error-nil
- expected-actual
- len
- require-error
- suite-dont-use-pkg
- suite-extra-assert-call
unparam:
check-exported: false
issues:
exclude-rules:
- path: zz_generated
linters:
- goimports
- linters:
- staticcheck
text: "SA1019:"
- path: test/e2e
linters:
- bodyclose
# Show the complete output
max-issues-per-linter: 0
max-same-issues: 0