Skip to content

Commit 6f2f992

Browse files
committed
update gloangci-lint
1 parent 4983b49 commit 6f2f992

File tree

4 files changed

+65
-57
lines changed

4 files changed

+65
-57
lines changed

.github/workflows/golangci-lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
go-version: stable
2929
cache: false
3030
- name: golangci-lint
31-
uses: golangci/golangci-lint-action@v3
31+
uses: golangci/golangci-lint-action@v8
3232
with:
3333
# Require: The version of golangci-lint to use.
3434
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
3535
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
36-
version: v1.60
36+
version: v2.1.6
3737
args: --timeout=30m

.golangci.yaml

Lines changed: 61 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,21 @@
1-
# options for analysis running
1+
version: "2"
22
run:
33
modules-download-mode: mod
4-
linters-settings:
5-
depguard:
6-
# Rules to apply.
7-
# Default: Only allow $gostd in all files.
8-
rules:
9-
# Name of a rule.
10-
main:
11-
# List of file globs that will match this list of settings to compare against.
12-
# Default: $all
13-
files:
14-
- "!**/*_a _file.go"
15-
# List of allowed packages.
16-
allow:
17-
- $gostd
18-
- k8s.io/apiextensions-apiserver
19-
- k8s.io/apimachinery
20-
- k8s.io/client-go/kubernetes
21-
- k8s.io/client-go/rest
22-
- k8s.io/api/core/v1
23-
- k8s.io/klog/v2
24-
- github.com/cert-manager/cert-manager
25-
- github.com/transip/gotransip/v6
26-
- github.com/demeesterdev/cert-manager-webhook-transip/transip
27-
# Packages that are not allowed where the value is a suggestion.
28-
misspell:
29-
locale: US
30-
goimports:
31-
local-prefixes: github.com/golangci/golangci-lint
32-
gocritic:
33-
enabled-tags:
34-
- performance
35-
- style
36-
- experimental
37-
disabled-checks:
38-
- whyNoLint
39-
- wrapperFunc
40-
revive:
41-
rules:
42-
- name: var-naming
43-
disabled: true
44-
454
linters:
46-
disable-all: true
5+
default: none
476
enable:
487
- bodyclose
498
- depguard
509
- dogsled
5110
- dupl
5211
- errcheck
53-
- exportloopref
5412
- exhaustive
5513
- funlen
5614
- goconst
5715
- gocritic
5816
- gocyclo
59-
- gofmt
60-
- goimports
6117
- goprintffuncname
6218
- gosec
63-
- gosimple
6419
- govet
6520
- ineffassign
6621
- lll
@@ -71,13 +26,66 @@ linters:
7126
- revive
7227
- rowserrcheck
7328
- staticcheck
74-
- typecheck
7529
- unconvert
7630
- unparam
7731
- unused
7832
- whitespace
79-
80-
issues:
81-
exclude-rules:
82-
- path: main_test\.go
83-
text: "may want to remove commented-out code"
33+
settings:
34+
depguard:
35+
rules:
36+
main:
37+
files:
38+
- '!**/*_a _file.go'
39+
allow:
40+
- $gostd
41+
- k8s.io/apiextensions-apiserver
42+
- k8s.io/apimachinery
43+
- k8s.io/client-go/kubernetes
44+
- k8s.io/client-go/rest
45+
- k8s.io/api/core/v1
46+
- k8s.io/klog/v2
47+
- github.com/cert-manager/cert-manager
48+
- github.com/transip/gotransip/v6
49+
- github.com/demeesterdev/cert-manager-webhook-transip/transip
50+
gocritic:
51+
disabled-checks:
52+
- whyNoLint
53+
- wrapperFunc
54+
enabled-tags:
55+
- performance
56+
- style
57+
- experimental
58+
misspell:
59+
locale: US
60+
revive:
61+
rules:
62+
- name: var-naming
63+
disabled: true
64+
exclusions:
65+
generated: lax
66+
presets:
67+
- comments
68+
- common-false-positives
69+
- legacy
70+
- std-error-handling
71+
rules:
72+
- path: main_test\.go
73+
text: may want to remove commented-out code
74+
paths:
75+
- third_party$
76+
- builtin$
77+
- examples$
78+
formatters:
79+
enable:
80+
- gofmt
81+
- goimports
82+
settings:
83+
goimports:
84+
local-prefixes:
85+
- github.com/golangci/golangci-lint
86+
exclusions:
87+
generated: lax
88+
paths:
89+
- third_party$
90+
- builtin$
91+
- examples$

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
files: (?!values.schema.json)
2626
- id: trailing-whitespace
2727
- repo: https://github.com/golangci/golangci-lint
28-
rev: v1.59.1
28+
rev: v2.1.6
2929
hooks:
3030
- id: golangci-lint-config-verify
3131
- id: golangci-lint

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.6-alpine3.20 AS build_deps
1+
FROM golang:1.24.3-alpine3.21 AS build_deps
22

33
RUN apk add --no-cache git
44

0 commit comments

Comments
 (0)