-
Notifications
You must be signed in to change notification settings - Fork 9
/
.golangci.yml
74 lines (70 loc) · 2.84 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# based on https://github.com/kubernetes/kubernetes/blame/e6218f3d3bede036b2d67a4349dd761aac06ae97/hack/golangci-strict.yaml
run:
timeout: 30m
skip-files:
- "^zz_generated.*"
issues:
max-same-issues: 0
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# exclude ineffassign linter for generated files for conversion
- path: conversion\.go
linters:
- ineffassign
# The Kubernetes naming convention for conversion functions uses underscores
# and intentionally deviates from normal Go conventions to make those function
# names more readable. Same for SetDefaults_*.
- linters:
- stylecheck
text: "ST1003: should not use underscores in Go names; func (Convert_.*_To_.*|SetDefaults_)"
# This check currently has some false positives (https://github.com/nunnatsa/ginkgolinter/issues/91).
- linters:
- ginkgolinter
text: use a function call in (Eventually|Consistently)
linters:
disable-all: false # in contrast to golangci.yaml, the default set of linters remains enabled
enable: # please keep this alphabetized and in sync with golangci.yaml
- dupword # add by kubebb
- ginkgolinter
- gci # add by kubebb
- gocritic
- govet
- ineffassign
# - logcheck # we do not need this linter
- mirror # add by kubebb
- staticcheck
- stylecheck
- unused
- whitespace
linters-settings: # please keep this alphabetized
# we do not import logcheck source code and package
# custom:
# logcheck:
# # Installed there by hack/verify-golangci-lint.sh.
# path: ../_output/local/bin/logcheck.so
# description: structured logging checker
# original-url: k8s.io/logtools/logcheck
gocritic:
staticcheck:
checks:
- "all"
stylecheck:
gci:
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/kubebb/core) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
# Skip generated files.
# Default: true
skip-generated: true
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true