Skip to content

Commit c01d0e2

Browse files
authored
Modernize golangci-lint config (#35)
- Enable bodyclose and prealloc linters - Move exclude-files/exclude-dirs to linters.exclusions.paths (golangci-lint v2 location) and fix over-escaped regex generated.*\\.go -> generated.*\.go - Switch formatter from gofmt to gofumpt and drop the interface{} -> any rewrite rule (gofumpt is a stricter superset) - Apply resulting gofumpt formatting Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent ac02dda commit c01d0e2

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

.golangci.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,22 @@ version: "2"
22
linters:
33
default: standard
44
enable:
5+
- bodyclose
6+
- prealloc
57
- unparam
8+
exclusions:
9+
paths:
10+
- generated.*\.go
11+
- client
12+
- vendor
613

714
formatters:
815
enable:
9-
- gofmt
16+
- gofumpt
1017
- goimports
11-
settings:
12-
gofmt:
13-
rewrite-rules:
14-
- pattern: 'interface{}'
15-
replacement: 'any'
1618

1719
issues:
1820
max-same-issues: 100
1921

20-
exclude-files:
21-
- generated.*\\.go
22-
23-
exclude-dirs:
24-
- client
25-
- vendor
26-
2722
run:
2823
timeout: 10m

0 commit comments

Comments
 (0)