Skip to content

Commit 853c348

Browse files
committed
moving config to a separate repo
0 parents  commit 853c348

File tree

3 files changed

+235
-0
lines changed

3 files changed

+235
-0
lines changed

.golangci.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
run:
2+
# timeout for analysis, e.g. 30s, 5m, default is 1m
3+
timeout: 3m
4+
5+
# default is true. Enables skipping of directories:
6+
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
7+
skip-dirs-use-default: true
8+
9+
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
10+
# If invoked with -mod=readonly, the go command is disallowed from the implicit
11+
# automatic updating of go.mod described above. Instead, it fails when any changes
12+
# to go.mod are needed. This setting is most useful to check that go.mod does
13+
# not need updates, such as in a continuous integration and testing system.
14+
# If invoked with -mod=vendor, the go command assumes that the vendor
15+
# directory holds the correct copies of dependencies and ignores
16+
# the dependency descriptions in go.mod.
17+
modules-download-mode: readonly
18+
19+
# Allow multiple parallel golangci-lint instances running.
20+
# If false (default) - golangci-lint acquires file lock on start.
21+
allow-parallel-runners: true
22+
23+
# which files to skip: they will be analyzed, but issues from them
24+
# won't be reported. Default value is empty list, but there is
25+
# no need to include all autogenerated files, we confidently recognize
26+
# autogenerated files. If it's not please let us know.
27+
skip-files:
28+
- "^.*\\_mock\\.go$"
29+
- "^.*\\.pb\\.go$"
30+
31+
linters:
32+
disable-all: true
33+
enable:
34+
- asciicheck
35+
- bodyclose
36+
- cyclop
37+
- deadcode
38+
- depguard
39+
- dogsled
40+
- dupl
41+
- durationcheck
42+
- errcheck
43+
- errorlint
44+
- exhaustive
45+
- exportloopref
46+
- forbidigo
47+
- forcetypeassert
48+
- funlen
49+
- gci
50+
- gas
51+
#- gochecknoglobals
52+
- gochecknoinits
53+
- gocognit
54+
- goconst
55+
- gocritic
56+
- gocyclo
57+
- godot
58+
- godox
59+
- goerr113
60+
- gofmt
61+
- gofumpt
62+
- goimports
63+
- gomnd
64+
- goprintffuncname
65+
- gosec
66+
- gosimple
67+
- govet
68+
- ifshort
69+
- importas
70+
- ineffassign
71+
- lll
72+
- makezero
73+
- maligned
74+
- nakedret
75+
- nestif
76+
- nilerr
77+
- nlreturn
78+
- noctx
79+
- nolintlint
80+
- paralleltest
81+
- prealloc
82+
- predeclared
83+
- revive # instead of golint
84+
- rowserrcheck
85+
- scopelint
86+
- sqlclosecheck
87+
- staticcheck
88+
- structcheck
89+
- stylecheck # instead of golint
90+
- testpackage
91+
- thelper
92+
- tparallel
93+
- typecheck
94+
- unconvert
95+
- unparam
96+
- unused
97+
- varcheck
98+
- wastedassign
99+
- whitespace
100+
- wrapcheck
101+
- wsl
102+
103+
linters-settings:
104+
errcheck:
105+
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
106+
# default is false: such cases aren't reported by default.
107+
check-type-assertions: true
108+
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
109+
# default is false: such cases aren't reported by default.
110+
check-blank: false
111+
gocyclo:
112+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
113+
min-complexity: 25
114+
cyclop:
115+
# the maximal code complexity to report
116+
max-complexity: 25
117+
# the maximal average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0)
118+
package-average: 10.0
119+
# should ignore tests (default false)
120+
skip-tests: false
121+
maligned:
122+
# print struct with more effective memory layout or not, false by default
123+
suggest-new: true
124+
dupl:
125+
# tokens count to trigger issue, 150 by default
126+
threshold: 110
127+
gocognit:
128+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
129+
min-complexity: 50
130+
lll:
131+
# max line length, lines longer will be reported. Default is 120.
132+
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
133+
line-length: 140
134+
# tab width in spaces. Default to 1.
135+
tab-width: 4
136+
wsl:
137+
# If true append is only allowed to be cuddled if appending value is
138+
# matching variables, fields or types on line above. Default is true.
139+
strict-append: true
140+
# Allow calls and assignments to be cuddled as long as the lines have any
141+
# matching variables, fields or types. Default is true.
142+
allow-assign-and-call: true
143+
# Allow multiline assignments to be cuddled. Default is true.
144+
allow-multiline-assign: true
145+
# Allow declarations (var) to be cuddled.
146+
allow-cuddle-declarations: true
147+
# Allow trailing comments in ending of blocks
148+
allow-trailing-comment: true
149+
# Force newlines in end of case at this limit (0 = never).
150+
force-case-trailing-whitespace: 0
151+
funlen:
152+
lines: 100
153+
statements: 50
154+
155+
issues:
156+
exclude:
157+
- composites
158+
159+
# Excluding configuration per-path, per-linter, per-text and per-source
160+
exclude-rules:
161+
- path: _test\.go
162+
linters:
163+
- gomnd
164+
- scopelint
165+
- funlen
166+
- dupl
167+
- cyclop
168+
- lll
169+
170+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
171+
max-issues-per-linter: 0
172+
173+
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
174+
max-same-issues: 0
175+
176+
# Fix found issues (if it's supported by the linter)
177+
fix: true
178+
179+
# golangci.com configuration
180+
# https://github.com/golangci/golangci/wiki/Configuration
181+
service:
182+
golangci-lint-version: 1.38.x # use the fixed version to not introduce new linters unexpectedly
183+
prepare:
184+
- echo "here I can run custom commands, but no preparation needed for this repo"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Spacetab.io
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
golang linter config
2+
--------------------
3+
4+
This is a repo with golangci-lint configuration file that is used in spacetab.io
5+
ci linter jobs.
6+
7+
LICENSE
8+
-------
9+
10+
MIT License
11+
12+
Copyright (c) 2021 Spacetab.io
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in all
22+
copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30+
SOFTWARE.

0 commit comments

Comments
 (0)