Skip to content

Commit 7b7c7e8

Browse files
golangci-lint v2 (#2273)
* build(deps): Bump golangci/golangci-lint-action from 6.5.1 to 7.0.0 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.1 to 7.0.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@4696ba8...1481404) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * lint: `golangci-lint` v2 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 46e118a commit 7b7c7e8

File tree

4 files changed

+34
-15
lines changed

4 files changed

+34
-15
lines changed

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ jobs:
2323
with:
2424
go-version-file: 'go.mod'
2525
- name: Run linters
26-
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1
26+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
2727
with:
28-
version: v1.64.4
28+
version: v2.0.1

.golangci.yml

+30-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,34 @@
1-
run:
2-
timeout: 5m
1+
version: "2"
32
linters:
3+
enable:
4+
- copyloopvar
5+
exclusions:
6+
generated: lax
7+
presets:
8+
- comments
9+
- common-false-positives
10+
- legacy
11+
- std-error-handling
12+
rules:
13+
- linters:
14+
- staticcheck
15+
path: terraform/
16+
- linters:
17+
- staticcheck
18+
text: 'ST1005:' # allow capitlized error strings
19+
paths:
20+
- terraform/
21+
- third_party$
22+
- builtin$
23+
- examples$
24+
formatters:
425
enable:
526
- gci
627
- gofmt
7-
- copyloopvar
8-
issues:
9-
exclude-dirs:
10-
- terraform/
11-
exclude-rules:
12-
- path: terraform/
13-
linters:
14-
- gosimple
28+
exclusions:
29+
generated: lax
30+
paths:
31+
- terraform/
32+
- third_party$
33+
- builtin$
34+
- examples$

plugin/discovery.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,10 @@ func pluginClientError(err error, config *tflint.PluginConfig) error {
156156
search := "Incompatible API version with plugin."
157157

158158
if strings.Contains(message, search) {
159-
message = strings.Replace(
159+
message = strings.ReplaceAll(
160160
message,
161161
search,
162162
fmt.Sprintf(`TFLint is not compatible with this version of the %q plugin. A newer TFLint or plugin version may be required.`, config.Name),
163-
-1,
164163
)
165164

166165
return errors.New(message)

tflint/annotation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func hclAnnotations(path string, file *hcl.File) (Annotations, hcl.Diagnostics)
5656
// tflint-ignore-file annotation
5757
match = fileAnnotationPattern.FindStringSubmatch(string(token.Bytes))
5858
if len(match) == 2 {
59-
if !(token.Range.Start.Line == 1 && token.Range.Start.Column == 1) {
59+
if token.Range.Start.Line != 1 || token.Range.Start.Column != 1 {
6060
diags = append(diags, &hcl.Diagnostic{
6161
Severity: hcl.DiagError,
6262
Summary: "tflint-ignore-file annotation must be written at the top of file",

0 commit comments

Comments
 (0)