Skip to content

Commit 8e0a92f

Browse files
committed
.golangci.yml: unified config w/ per-project extensions
This commit creates a .golangci.yml in the git topdir. Subprojects then extend this config. Helps to avoid duplication wherever relevant. Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent d0867db commit 8e0a92f

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

.golangci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gofumpt
6+
7+
linters:
8+
settings:
9+
staticcheck:
10+
checks:
11+
- all
12+
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.
13+
exclusions:
14+
presets:
15+
- comments
16+
- common-false-positives
17+
- std-error-handling
18+
19+
issues:
20+
max-issues-per-linter: 0
21+
max-same-issues: 0

common/.golangci.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
version: "2"
22

3+
# Extend the root configuration
4+
extends: ../.golangci.yml
5+
36
run:
47
timeout: 5m
58
build-tags:
@@ -11,10 +14,6 @@ run:
1114
- containers_image_openpgp
1215
- cni
1316

14-
formatters:
15-
enable:
16-
- gofumpt
17-
1817
linters:
1918
enable:
2019
- asasalint
@@ -87,7 +86,3 @@ linters:
8786
- contextcheck
8887
path: libimage
8988
text: LookupImage
90-
91-
issues:
92-
max-issues-per-linter: 0
93-
max-same-issues: 0

image/.golangci.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
version: "2"
22

3-
formatters:
4-
enable:
5-
- gofumpt
3+
# Extend the root configuration
4+
extends: ../.golangci.yml
65

76
linters:
87
enable:
@@ -21,7 +20,3 @@ linters:
2120
- comments
2221
- common-false-positives
2322
- std-error-handling
24-
25-
issues:
26-
max-issues-per-linter: 0
27-
max-same-issues: 0

storage/.golangci.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
version: "2"
22

3-
formatters:
4-
enable:
5-
- gofumpt
3+
# Extend the root configuration
4+
extends: ../.golangci.yml
65

76
linters:
87
enable:
98
- nolintlint
109
- unconvert
11-
exclusions:
12-
presets:
13-
- comments
14-
- std-error-handling
1510
settings:
1611
staticcheck:
1712
checks:
1813
- all
1914
- -ST1003 # https://staticcheck.dev/docs/checks/#ST1003 Poorly chosen identifier.
2015
- -QF1008 # https://staticcheck.dev/docs/checks/#QF1008 Omit embedded fields from selector expression.
21-
22-
issues:
23-
max-issues-per-linter: 0
24-
max-same-issues: 0
16+
exclusions:
17+
presets:
18+
- comments
19+
- common-false-positives
20+
- std-error-handling

0 commit comments

Comments
 (0)