generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.golangci.yaml
117 lines (117 loc) · 4.34 KB
/
.golangci.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
linters:
enable-all: true
disable:
- contextcheck # too many false positives
- depguard # checks if package imports are whitelisted
- exhaustruct # too subjective and harms code readability
- execinquery # deprecated (since v1.58.0)
- exportloopref # deprecated (since v1.60.2), replaced by copyloopvar
- forbidigo # temporarily disabled
- godot # not needed
- gomnd # deprecated (since v1.58.0), renamed to mnd
- lll
- nlreturn # too strict and mostly code is not more readable
- sqlclosecheck # not needed for this project
- tagalign # TODO enable this and fix tags
- tagliatelle # TODO enable this and fix tags
- paralleltest # should be enabled consciously for long running tests
- wsl # too strict and mostly code is not more readable
linters-settings:
revive:
severity: error
rules:
- name: comment-spacings
disabled: true
- name: dot-imports
severity: warning
disabled: true
- name: line-length-limit
severity: warning
disabled: true
arguments: [120]
funlen:
statements: 50
lines: 80
ignore-comments: true
cyclop:
max-complexity: 20
nestif:
min-complexity: 6
gci:
sections:
- standard # Standard packages.
- default # Imports that could not be matched to another section type.
- prefix(github.com/kyma-project/modulectl) # Imports with the specified prefix.
- blank # Blank imports.
- dot # Dot imports.
custom-order: true
skip-generated: true
nolintlint:
require-explanation: true
importas:
no-unaliased: true
no-extra-aliases: true
alias:
- pkg: github.com/kyma-project/modulectl/tools/io
alias: iotools
- pkg: github.com/kyma-project/modulectl/internal/common/errors
alias: commonerrors
- pkg: github.com/kyma-project/modulectl/cmd/modulectl/scaffold
alias: scaffoldcmd
- pkg: github.com/kyma-project/modulectl/cmd/modulectl/create
alias: createcmd
- pkg: github.com/kyma-project/modulectl/internal/service/moduleconfig/generator
alias: moduleconfiggenerator
- pkg: github.com/kyma-project/modulectl/internal/service/moduleconfig/reader
alias: moduleconfigreader
- pkg: ocm.software/ocm/api/ocm/compdesc/meta/v1
alias: ocmv1
- pkg: ocm.software/ocm/cmds/ocm/commands/ocmcmds/common/inputs/types/ociartifact
alias: ociartifacttypes
- pkg: ocm.software/ocm/api/oci/extensions/repositories/ocireg
alias: ocirepo
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
alias: metav1
ireturn:
allow:
- anon
- error
- empty
- stdlib
- vfs.FileSystem
- internal.BlobAccess
- internal.ComponentVersionAccess
- internal.Credentials
- internal.Repository
varnamelen:
ignore-names:
- ok
ignore-type-assert-ok: true
ignore-map-index-ok: true
ignore-chan-recv-ok: true
issues:
exclude-rules:
- path: "_test\\.go"
linters:
- dupl # Table driven unit and integration tests are expected to have duplicate code
- goconst # To be descriptive in tests we sometimes don't extract constants
- varnamelen # Table driven unit and integration tests are expected to have short variable names
- wrapcheck # Errors do not need to be wrapped in unit and integration tests
- err113 # Dynamic error creation in unit and integration tests is ok
- gochecknoglobals # Does not apply to unit and integration tests
- funlen # Table driven unit and integration tests exceed function length by design
- maintidx # Table driven unit and integration tests exceed maintainability index by design
- path: tests/e2e/
linters: [gci] # Disable gci due to the test utilities dot import.
- linters:
- importas
text: has alias "" which is not part of config # Ignore false positives that emerged due to https://github.com/julz/importas/issues/15.
- linters:
- lll # long lines starting with an url
source: "^// http "
max-issues-per-linter: 0
max-same-issues: 0
output:
sort-results: true
run:
timeout: 15m