-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy path.golangci.yml
More file actions
66 lines (64 loc) · 2.33 KB
/
.golangci.yml
File metadata and controls
66 lines (64 loc) · 2.33 KB
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
# Copyright 2025-Present Couchbase, Inc.
#
# Use of this software is governed by the Business Source License included
# in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
# in that file, in accordance with the Business Source License, use of this
# software will be governed by the Apache License, Version 2.0, included in
# the file licenses/APL2.txt.
version: "2"
linters:
enable:
- bodyclose # checks whether HTTP response body is closed successfully
- dupl # Tool for code clone detection
- exhaustive
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # The most opinionated Go source code linter
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
- gosec # Inspects source code for security problems
- misspell # Finds commonly misspelled English words in comments
- nakedret # Finds naked returns in functions greater than a specified function length
- prealloc # Finds slice declarations that could potentially be preallocated
- revive # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
settings:
exhaustive:
check:
- switch
- map
default-signifies-exhaustive: true
explicit-exhaustive-map: true
ignore-enum-members: "(auditdSyncGatewayEndID|levelCount)" # these mark end of an enum
gocritic:
enabled-checks:
- ruleguard
settings:
ruleguard:
failOn: all
rules: ${base-path}/ruleguard/rules-*.go
govet:
enable:
- fieldalignment
exclusions:
generated: strict
rules:
- linters:
# Disable goconst in test files, often we have duplicated strings across tests, but don't make sense as constants.
- goconst
- prealloc
path: (_test.*\.go)
- linters:
- govet
path: (_test.*\.go)
text: fieldalignment # detect Go structs that would take less memory if their fields were sorted
- text: "missing cases in switch"
linters:
- exhaustive
path: (_test.go)
formatters:
enable:
- goimports
exclusions:
generated: strict
run:
allow-parallel-runners: true