Skip to content

Commit d1fd01b

Browse files
chore(deps): bump golangci/golangci-lint-action from 6 to 7 (#136)
* chore(deps): bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Fix * Fix --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent 8fbcaad commit d1fd01b

File tree

2 files changed

+143
-136
lines changed

2 files changed

+143
-136
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
# We could run 'make lint' but we prefer this action because it leaves
7070
# 'annotations' (i.e. it comments on PRs to point out linter violations).
7171
- name: Lint
72-
uses: golangci/golangci-lint-action@v6
72+
uses: golangci/golangci-lint-action@v7
7373
with:
7474
version: latest
7575
args: --timeout 10m

.golangci.yml

Lines changed: 142 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,164 @@
1+
version: "2"
2+
13
output:
24
formats:
3-
- format: colored-line-number
4-
5-
linters-settings:
6-
errcheck:
7-
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
8-
# default is false: such cases aren't reported by default.
9-
check-type-assertions: false
10-
11-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
12-
# default is false: such cases aren't reported by default.
13-
check-blank: false
14-
15-
16-
govet:
17-
# report about shadowed variables
18-
disable:
19-
- shadow
20-
21-
gofmt:
22-
# simplify code: gofmt with `-s` option, true by default
23-
simplify: true
24-
25-
goimports:
26-
# put imports beginning with prefix after 3rd-party packages;
27-
# it's a comma-separated list of prefixes
28-
local-prefixes: github.com/upbound/upjet-provider-template
29-
30-
gocyclo:
31-
# minimal code complexity to report, 30 by default (but we recommend 10-20)
32-
min-complexity: 10
33-
34-
dupl:
35-
# tokens count to trigger issue, 150 by default
36-
threshold: 100
37-
38-
goconst:
39-
# minimal length of string constant, 3 by default
40-
min-len: 3
41-
# minimal occurrences count to trigger, 3 by default
42-
min-occurrences: 5
43-
44-
lll:
45-
# tab width in spaces. Default to 1.
46-
tab-width: 1
47-
48-
unparam:
49-
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
50-
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
51-
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
52-
# with golangci-lint call it on a directory with the changed file.
53-
check-exported: false
54-
55-
nakedret:
56-
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
57-
max-func-lines: 30
58-
59-
prealloc:
60-
# XXX: we don't recommend using this linter before doing performance profiling.
61-
# For most programs usage of prealloc will be a premature optimization.
62-
63-
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
64-
# True by default.
65-
simple: true
66-
range-loops: true # Report preallocation suggestions on range loops, true by default
67-
for-loops: false # Report preallocation suggestions on for loops, false by default
68-
69-
gocritic:
70-
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
71-
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
72-
enabled-tags:
73-
- performance
74-
75-
settings: # settings passed to gocritic
76-
captLocal: # must be valid enabled check name
77-
paramsOnly: true
78-
rangeValCopy:
79-
sizeThreshold: 32
5+
text:
6+
colors: true
7+
8+
formatters:
9+
enable:
10+
- gofmt # We enable this as well as goimports for its simplify mode.
11+
- goimports
12+
13+
settings:
14+
goimports:
15+
# put imports beginning with prefix after 3rd-party packages;
16+
# it's a comma-separated list of prefixes
17+
local-prefixes:
18+
- github.com/upbound/upjet-provider-template
19+
20+
gofmt:
21+
# simplify code: gofmt with `-s` option, true by default
22+
simplify: true
8023

8124
linters:
25+
exclusions:
26+
paths:
27+
- "zz_\\..+\\.go$"
28+
rules:
29+
# Exclude some linters from running on tests files.
30+
- path: _test(ing)?\.go
31+
linters:
32+
- gocyclo
33+
- errcheck
34+
- dupl
35+
- gosec
36+
- scopelint
37+
- unparam
38+
39+
# Ease some gocritic warnings on test files.
40+
- path: _test\.go
41+
text: "(unnamedResult|exitAfterDefer)"
42+
linters:
43+
- gocritic
44+
45+
# These are performance optimisations rather than style issues per se.
46+
# They warn when function arguments or range values copy a lot of memory
47+
# rather than using a pointer.
48+
- text: "(hugeParam|rangeValCopy):"
49+
linters:
50+
- gocritic
51+
52+
# This "TestMain should call os.Exit to set exit code" warning is not clever
53+
# enough to notice that we call a helper method that calls os.Exit.
54+
- text: "SA3000:"
55+
linters:
56+
- staticcheck
57+
58+
- text: "k8s.io/api/core/v1"
59+
linters:
60+
- goimports
61+
62+
# This is a "potential hardcoded credentials" warning. It's triggered by
63+
# any variable with 'secret' in the same, and thus hits a lot of false
64+
# positives in Kubernetes land where a Secret is an object type.
65+
- text: "G101:"
66+
linters:
67+
- gosec
68+
- gas
69+
70+
# This is an 'errors unhandled' warning that duplicates errcheck.
71+
- text: "G104:"
72+
linters:
73+
- gosec
74+
- gas
75+
76+
default: none
8277
enable:
83-
- gosimple
8478
- staticcheck
8579
- unused
8680
- govet
8781
- gocyclo
8882
- gocritic
8983
- goconst
90-
- goimports
91-
- gofmt # We enable this as well as goimports for its simplify mode.
9284
- prealloc
9385
- revive
9486
- unconvert
9587
- misspell
9688
- nakedret
9789

98-
presets:
99-
- bugs
100-
- unused
101-
fast: false
102-
90+
settings:
91+
errcheck:
92+
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
93+
# default is false: such cases aren't reported by default.
94+
check-type-assertions: false
95+
96+
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
97+
# default is false: such cases aren't reported by default.
98+
check-blank: false
99+
100+
govet:
101+
# report about shadowed variables
102+
disable:
103+
- shadow
104+
105+
gocyclo:
106+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
107+
min-complexity: 10
108+
109+
dupl:
110+
# tokens count to trigger issue, 150 by default
111+
threshold: 100
112+
113+
goconst:
114+
# minimal length of string constant, 3 by default
115+
min-len: 3
116+
# minimal occurrences count to trigger, 3 by default
117+
min-occurrences: 5
118+
119+
lll:
120+
# tab width in spaces. Default to 1.
121+
tab-width: 1
122+
123+
unparam:
124+
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
125+
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
126+
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
127+
# with golangci-lint call it on a directory with the changed file.
128+
check-exported: false
129+
130+
nakedret:
131+
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
132+
max-func-lines: 30
133+
134+
prealloc:
135+
# XXX: we don't recommend using this linter before doing performance profiling.
136+
# For most programs usage of prealloc will be a premature optimization.
137+
138+
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
139+
# True by default.
140+
simple: true
141+
range-loops: true # Report preallocation suggestions on range loops, true by default
142+
for-loops: false # Report preallocation suggestions on for loops, false by default
143+
144+
gocritic:
145+
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
146+
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
147+
enabled-tags:
148+
- performance
149+
150+
settings: # settings passed to gocritic
151+
captLocal: # must be valid enabled check name
152+
paramsOnly: true
153+
rangeValCopy:
154+
sizeThreshold: 32
155+
156+
revive:
157+
rules:
158+
- name: package-comments
159+
disabled: true
103160

104161
issues:
105-
exclude-files:
106-
- "zz_\\..+\\.go$"
107-
# Excluding configuration per-path and per-linter
108-
exclude-rules:
109-
# Exclude some linters from running on tests files.
110-
- path: _test(ing)?\.go
111-
linters:
112-
- gocyclo
113-
- errcheck
114-
- dupl
115-
- gosec
116-
- scopelint
117-
- unparam
118-
119-
# Ease some gocritic warnings on test files.
120-
- path: _test\.go
121-
text: "(unnamedResult|exitAfterDefer)"
122-
linters:
123-
- gocritic
124-
125-
# These are performance optimisations rather than style issues per se.
126-
# They warn when function arguments or range values copy a lot of memory
127-
# rather than using a pointer.
128-
- text: "(hugeParam|rangeValCopy):"
129-
linters:
130-
- gocritic
131-
132-
# This "TestMain should call os.Exit to set exit code" warning is not clever
133-
# enough to notice that we call a helper method that calls os.Exit.
134-
- text: "SA3000:"
135-
linters:
136-
- staticcheck
137-
138-
- text: "k8s.io/api/core/v1"
139-
linters:
140-
- goimports
141-
142-
# This is a "potential hardcoded credentials" warning. It's triggered by
143-
# any variable with 'secret' in the same, and thus hits a lot of false
144-
# positives in Kubernetes land where a Secret is an object type.
145-
- text: "G101:"
146-
linters:
147-
- gosec
148-
- gas
149-
150-
# This is an 'errors unhandled' warning that duplicates errcheck.
151-
- text: "G104:"
152-
linters:
153-
- gosec
154-
- gas
155162

156163
# Show only new issues: if there are unstaged changes or untracked files,
157164
# only those changes are analyzed, else only changes in HEAD~ are analyzed.

0 commit comments

Comments
 (0)