Skip to content

Commit c0dc4cb

Browse files
bytemareclaucece
authored andcommitted
Update CI and dependencies (bytemare#95)
* update ci, some minor refactoring, linting Signed-off-by: bytemare <[email protected]> * update dependencies Signed-off-by: bytemare <[email protected]> --------- Signed-off-by: bytemare <[email protected]>
1 parent cb13679 commit c0dc4cb

File tree

19 files changed

+183
-402
lines changed

19 files changed

+183
-402
lines changed

.github/.golangci.yml

Lines changed: 85 additions & 295 deletions
Original file line numberDiff line numberDiff line change
@@ -1,295 +1,85 @@
1-
linters:
2-
disable-all: true
3-
enable:
4-
- asasalint
5-
- asciicheck
6-
- bidichk
7-
- bodyclose
8-
- canonicalheader
9-
- containedctx
10-
- contextcheck
11-
- copyloopvar
12-
- cyclop
13-
- decorder
14-
#- depguard
15-
- dogsled
16-
- dupl
17-
- dupword
18-
- durationcheck
19-
- err113
20-
- errcheck
21-
- errchkjson
22-
- errname
23-
- errorlint
24-
- exhaustive
25-
- exhaustruct
26-
- fatcontext
27-
- forbidigo
28-
- forcetypeassert
29-
- funlen
30-
- gci
31-
- ginkgolinter
32-
- gocheckcompilerdirectives
33-
#- gochecknoglobals
34-
#- gochecknoinits
35-
- gochecksumtype
36-
- gocognit
37-
- goconst
38-
- gocritic
39-
- gocyclo
40-
- godot
41-
- godox
42-
- gofmt
43-
- gofumpt
44-
- goheader
45-
- goimports
46-
- gomoddirectives
47-
- gomodguard
48-
- goprintffuncname
49-
- gosec
50-
- gosimple
51-
- gosmopolitan
52-
- govet
53-
- grouper
54-
- importas
55-
- inamedparam
56-
- ineffassign
57-
- interfacebloat
58-
- intrange
59-
- ireturn
60-
- lll
61-
- loggercheck
62-
- maintidx
63-
- makezero
64-
- mirror
65-
- misspell
66-
#- mnd
67-
- musttag
68-
- nakedret
69-
- nestif
70-
- nilerr
71-
- nilnil
72-
- nlreturn
73-
- noctx
74-
- nolintlint
75-
#- nonamedreturns
76-
- nosprintfhostport
77-
- paralleltest
78-
- perfsprint
79-
- prealloc
80-
- predeclared
81-
- promlinter
82-
- protogetter
83-
- reassign
84-
- revive
85-
- rowserrcheck
86-
- sloglint
87-
- spancheck
88-
- sqlclosecheck
89-
- staticcheck
90-
- stylecheck
91-
- tagalign
92-
- tagliatelle
93-
- testableexamples
94-
- testifylint
95-
- testpackage
96-
- thelper
97-
- tparallel
98-
- typecheck
99-
- unconvert
100-
- unparam
101-
- unused
102-
- usestdlibvars
103-
- usetesting
104-
#- varnamelen
105-
- wastedassign
106-
- whitespace
107-
- wrapcheck
108-
- wsl
109-
- zerologlint
110-
111-
linters-settings:
112-
cyclop:
113-
max-complexity: 15
114-
skip-tests: true
115-
dupl:
116-
threshold: 100
117-
errcheck:
118-
check-type-assertions: true
119-
check-blank: false
120-
#exclude-functions:
121-
# - io/ioutil.ReadFile
122-
# - io.Copy(*bytes.Buffer)
123-
# - io.Copy(os.Stdout)
124-
funlen:
125-
lines: 100
126-
statements: 50
127-
gci:
128-
sections:
129-
- standard # Standard section: captures all standard packages.
130-
- default # Default section: contains all imports that could not be matched to another section type.
131-
- prefix(github.com/bytemare/opaque) # Custom section: groups all imports with the specified Prefix.
132-
skip-generated: true
133-
# Enable custom order of sections.
134-
# If `true`, make the section order the same as the order of `sections`.
135-
# Default: false
136-
custom-order: true
137-
gocognit:
138-
min-complexity: 15
139-
goconst:
140-
min-len: 2
141-
min-occurrences: 2
142-
gocritic:
143-
enabled-tags:
144-
- diagnostic
145-
- experimental
146-
- opinionated
147-
- performance
148-
- style
149-
disabled-checks:
150-
- sloppyReassign
151-
gocyclo:
152-
min-complexity: 15
153-
godox:
154-
keywords:
155-
- NOTE
156-
- OPTIMIZE
157-
- HACK
158-
- TODO
159-
- todo
160-
gofmt:
161-
simplify: true
162-
goimports:
163-
local-prefixes: github.com/bytemare/opaque
164-
gomnd:
165-
checks:
166-
- argument
167-
- case
168-
- condition
169-
- operation
170-
- return
171-
- assign
172-
gosec:
173-
excludes:
174-
- G101
175-
- G115
176-
gosimple:
177-
checks: [ "all" ]
178-
govet:
179-
shadow: true
180-
disable-all: true
181-
enable:
182-
- asmdecl
183-
- assign
184-
- atomic
185-
- atomicalign
186-
- bools
187-
- buildtag
188-
- cgocall
189-
- composites
190-
- copylocks
191-
- deepequalerrors
192-
- errorsas
193-
- fieldalignment
194-
- findcall
195-
- framepointer
196-
- httpresponse
197-
- ifaceassert
198-
- loopclosure
199-
- lostcancel
200-
- nilfunc
201-
- nilness
202-
- printf
203-
- reflectvaluecompare
204-
- shadow
205-
- shift
206-
- sigchanyzer
207-
- sortslice
208-
- stdmethods
209-
- stringintconv
210-
- structtag
211-
- testinggoroutine
212-
- tests
213-
- unmarshal
214-
- unreachable
215-
- unsafeptr
216-
- unusedresult
217-
- unusedwrite
218-
lll:
219-
line-length: 120
220-
# tab width ('\t') in spaces. Default to 1.
221-
tab-width: 4
222-
misspell:
223-
locale: US
224-
mnd:
225-
checks:
226-
- argument
227-
- case
228-
- condition
229-
- operation
230-
- return
231-
- assign
232-
#ignored-functions:
233-
# - 'nist.setMapping'
234-
# - 'big.NewInt'
235-
# - 'hash2curve.HashToFieldXMD'
236-
nlreturn:
237-
block-size: 2
238-
prealloc:
239-
simple: false
240-
for-loops: true
241-
unused:
242-
check-exported: false
243-
whitespace:
244-
multi-if: false
245-
multi-func: false
246-
wsl:
247-
# Allow declarations (var) to be cuddled.
248-
allow-cuddle-declarations: true
249-
# Allow trailing comments in ending of blocks
250-
allow-trailing-comment: false
251-
# Force newlines in end of case at this limit (0 = never).
252-
force-case-trailing-whitespace: 0
253-
# Force cuddling of err checks with err var assignment
254-
force-err-cuddling: true
255-
# Allow leading comments to be separated with empty liens
256-
allow-separated-leading-comment: false
257-
258-
issues:
259-
# List of regexps of issue texts to exclude, empty list by default.
260-
# But independently from this option we use default exclude patterns,
261-
# it can be disabled by `exclude-use-default: false`. To list all
262-
# excluded by default patterns execute `golangci-lint run --help`
263-
#exclude:
264-
#- "should have a package comment, unless it's in another file for this package"
265-
#- "do not define dynamic errors, use wrapped static errors instead"
266-
#- "missing cases in switch of type Group: maxID"
267-
268-
#exclude-rules:
269-
# - path: internal/hash.go
270-
# linters:
271-
# - errcheck
272-
# - path: internal/tag/strings.go
273-
# linters:
274-
# - gosec
275-
276-
max-issues-per-linter: 0
277-
max-same-issues: 0
278-
279-
# Independently of option `exclude` we use default exclude patterns,
280-
# it can be disabled by this option. To list all
281-
# excluded by default patterns execute `golangci-lint run --help`.
282-
# Default value for this option is true.
283-
exclude-use-default: false
284-
285-
run:
286-
tests: false
287-
288-
output:
289-
formats:
290-
- format: colored-line-number
291-
path: stdout
292-
sort-results: true
293-
sort-order:
294-
- file
295-
show-stats: true
1+
version: "2"
2+
linters:
3+
default: all
4+
disable:
5+
- funcorder
6+
- nonamedreturns
7+
- varnamelen
8+
settings:
9+
cyclop:
10+
max-complexity: 13
11+
depguard:
12+
rules:
13+
main:
14+
list-mode: lax
15+
allow:
16+
- golang.org/x/crypto/*
17+
errcheck:
18+
check-type-assertions: true
19+
check-blank: true
20+
gocritic:
21+
enable-all: true
22+
govet:
23+
enable-all: true
24+
settings:
25+
shadow:
26+
strict: true
27+
interfacebloat:
28+
max: 11
29+
mnd:
30+
checks:
31+
- argument
32+
- case
33+
- condition
34+
- operation
35+
- return
36+
- assign
37+
ignored-numbers:
38+
- '2'
39+
- '3'
40+
- '4'
41+
- '8'
42+
nlreturn:
43+
block-size: 2
44+
prealloc:
45+
simple: false
46+
for-loops: true
47+
48+
exclusions:
49+
rules:
50+
- path: internal/hash.go
51+
text: "Error return value of `h.h.Write` is not checked"
52+
- path: internal/tag/strings.go
53+
text: "G101: Potential hardcoded credentials"
54+
issues:
55+
max-issues-per-linter: 0
56+
max-same-issues: 0
57+
formatters:
58+
enable:
59+
- gci
60+
- gofmt
61+
- gofumpt
62+
- goimports
63+
- golines
64+
settings:
65+
gci:
66+
sections:
67+
- standard
68+
- default
69+
- prefix(github.com/bytemare/opaque)
70+
- blank
71+
- dot
72+
- alias
73+
no-inline-comments: true
74+
no-prefix-comments: true
75+
custom-order: true
76+
goimports:
77+
local-prefixes:
78+
- github.com/bytemare/opaque
79+
golines:
80+
max-len: 200
81+
output:
82+
sort-order:
83+
- file
84+
run:
85+
tests: false

0 commit comments

Comments
 (0)