Skip to content

Update golangci config #694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
67 changes: 22 additions & 45 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,41 @@
linters-settings:
go-mod-tidy:
enabled: true
gci:
enabled: true
max-len: 120
line-length: 120
goconst:
enabled: true
gocritic:
enabled: true
disable:
- parallelize
- nesting
- hugeParam
- hugeStruct
- nestParam
- prealloc
govet:
enabled: true
shadow: true
tests: true
golint:
enabled: true
min-confidence: 0.8
enable:
- shadow
- tests
revive:
confidence: 0.8
rules:
- name: line-length-limit
arguments: [120]
unused:
enabled: true
check-exported: true
check-packages: true
check-generated: true
tests: true
allow-unused-type-export: true
exported-fields-are-used: false
local-variables-are-used: false
generated-is-used: false
cyclop:
enabled: true
average-strictness: 7
scopelint:
enabled: true
tests: true

max-complexity: 7

# Configuration for golangci-lint that is suitable for a Kubernetes operator project built with Golang
linters:
enable-all: false
disable-all: false
linters:
- gci
enable:
- goconst
- gocritic
- govet
- golint
- revive # Replaces golint
- unused
- cyclop
- scopelint
exclude-rules:
- testpackage
issues:
exclude-dirs:
- copyloopvar # Replaces scopelint
issues:
exclude-dirs:
- vendor
- bundle
- hack
- img
exclude-rules:
- path: _test\.go
linters:
- testpackage
run:
timeout: 5m
enable-cache: true
timeout: 5m
Loading