mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-01-06 05:27:23 +00:00
The unused-parameter linter became stricter, so we adjust it to allow unused params that start with underscore. It can be nice to keep unused param names when implementing an interface sometimes, to help readers understand why it is unused in that particular implementation.
79 lines
1.7 KiB
YAML
79 lines
1.7 KiB
YAML
# https://github.com/golangci/golangci-lint#config-file
|
|
run:
|
|
deadline: 1m
|
|
skip-dirs:
|
|
- generated
|
|
|
|
linters:
|
|
disable-all: true
|
|
enable:
|
|
# default linters
|
|
- errcheck
|
|
- gosimple
|
|
- govet
|
|
- ineffassign
|
|
- staticcheck
|
|
- typecheck
|
|
- unused
|
|
|
|
# additional linters for this project (we should disable these if they get annoying).
|
|
- asciicheck
|
|
- bodyclose
|
|
# - depguard
|
|
- dogsled
|
|
- exhaustive
|
|
- exportloopref
|
|
- funlen
|
|
- gochecknoglobals
|
|
- gochecknoinits
|
|
- gocritic
|
|
- gocyclo
|
|
- godot
|
|
- goheader
|
|
- goimports
|
|
- revive
|
|
- goprintffuncname
|
|
- gosec
|
|
- misspell
|
|
- nakedret
|
|
- nestif
|
|
- noctx
|
|
- nolintlint
|
|
- prealloc
|
|
- rowserrcheck
|
|
- exportloopref
|
|
- sqlclosecheck
|
|
- unconvert
|
|
- whitespace
|
|
|
|
issues:
|
|
exclude-rules:
|
|
# exclude tests from some rules for things that are useful in a testing context.
|
|
- path: _test\.go
|
|
linters:
|
|
- funlen
|
|
- gochecknoglobals
|
|
|
|
linters-settings:
|
|
funlen:
|
|
lines: 150
|
|
statements: 50
|
|
goheader:
|
|
values:
|
|
regexp:
|
|
# YYYY or YYYY-YYYY
|
|
YEARS: \d\d\d\d(-\d\d\d\d)?
|
|
template: |-
|
|
Copyright {{YEARS}} the Pinniped contributors. All Rights Reserved.
|
|
SPDX-License-Identifier: Apache-2.0
|
|
goimports:
|
|
local-prefixes: go.pinniped.dev
|
|
revive:
|
|
max-open-files: 2048
|
|
rules:
|
|
- name: unused-parameter
|
|
arguments:
|
|
# Allow unused params that start with underscore. It can be nice to keep unused param names when implementing
|
|
# an interface sometimes, to help readers understand why it is unused in that particular implementation.
|
|
- allowRegex: "^_"
|